Japanese translation of message catalog for Sawfish Window-Manager
Revisão | 7edfb1c714c1049f9cfafe0b312bb61bc20437cd (tree) |
---|---|
Hora | 2010-05-24 00:18:53 |
Autor | Christopher Roy Bratusek <zanghar@free...> |
Commiter | Christopher Roy Bratusek |
added border_with and border_color frame-part attributes
@@ -1,5 +1,10 @@ | ||
1 | 1 | 2010-05-23 Christopher Roy Bratusek <zanghar@freenet.de> |
2 | - * lisp/sawfish/wm/util/prompt.jl: fix an unconfirmed compilation-error that has been reported | |
2 | + * man/sawfish.texi | |
3 | + * src/events.c | |
4 | + * src/frames.c | |
5 | + * src/sawfish.h | |
6 | + * src/windows.c: added border_with and border_color frame-part attributes | |
7 | + -- [Alexey I. Froloff] | |
3 | 8 | |
4 | 9 | 2010-05-16 Christopher Bratusek <zanghar@freenet.de> |
5 | 10 | * src/display.c: allow compilation with -DDEBUG |
@@ -11,6 +11,15 @@ they occurred between. For more detailed information see the | ||
11 | 11 | |
12 | 12 | @heading 1.6.4 "Frozen Flame" |
13 | 13 | |
14 | +@itemize @bullet | |
15 | + | |
16 | +@item New Features | |
17 | +@itemize @minus | |
18 | +@item Added border_with and border_color frame-part attributes | |
19 | +[Alexey I. Froloff] | |
20 | +@end itemize | |
21 | +@end itemize | |
22 | + | |
14 | 23 | @heading 1.6.3 "Hava Nagila" |
15 | 24 | |
16 | 25 | @itemize @bullet |
@@ -3630,6 +3630,12 @@ Defines the width of the frame part. | ||
3630 | 3630 | @item (height . @var{value}) |
3631 | 3631 | Defines the height of the frame part. |
3632 | 3632 | |
3633 | +@item (border-width . @var{value}) | |
3634 | +Defines window border width. | |
3635 | + | |
3636 | +@item (border-color . @var{value}) | |
3637 | +Defines window border color. | |
3638 | + | |
3633 | 3639 | @item (keymap . @var{value}) |
3634 | 3640 | Defines the keymap to use when evaluating events originating in this |
3635 | 3641 | frame part. |
@@ -3659,10 +3665,14 @@ frame part. | ||
3659 | 3665 | The values specified for the @code{background}, @code{foreground}, |
3660 | 3666 | @code{render-scale}, @code{font}, @code{left-edge}, @code{right-edge}, |
3661 | 3667 | @code{top-edge}, @code{bottom-edge}, @code{width}, @code{height}, |
3662 | -@code{cursor}, @code{below-client} and @code{hidden} attributes may | |
3663 | -actually be functions. In which case the function will be called (with | |
3664 | -a single argument, the window object) when the frame is constructed, | |
3665 | -the value returned will be used as the actual value of the attribute. | |
3668 | +@code{border-color}, @code{cursor}, @code{below-client} and | |
3669 | +@code{hidden} attributes may actually be functions. In which case the | |
3670 | +function will be called (with a single argument, the window object) | |
3671 | +when the frame is constructed, the value returned will be used as the | |
3672 | +actual value of the attribute. | |
3673 | + | |
3674 | +The values specified for the @code{border-width} and @code{border-color} | |
3675 | +are applied for the whole window instead of current frame part. | |
3666 | 3676 | |
3667 | 3677 | The coordinate system used for specifying the part's position is |
3668 | 3678 | relative to the window edge that the position is defined against. |
@@ -1317,7 +1317,7 @@ send_synthetic_configure (Lisp_Window *w) | ||
1317 | 1317 | } |
1318 | 1318 | ev.xconfigure.width = w->attr.width; |
1319 | 1319 | ev.xconfigure.height = w->attr.height; |
1320 | - ev.xconfigure.border_width = w->attr.border_width; | |
1320 | + ev.xconfigure.border_width = w->border_width; | |
1321 | 1321 | ev.xconfigure.above = w->reparented ? w->frame : root_window; |
1322 | 1322 | ev.xconfigure.override_redirect = False; |
1323 | 1323 | XSendEvent (dpy, w->id, False, StructureNotifyMask, &ev); |
@@ -86,6 +86,8 @@ DEFSYM(override_frame_part_classes, "override-frame-part-classes"); | ||
86 | 86 | DEFSYM(below_client, "below-client"); |
87 | 87 | DEFSYM(scale_foreground, "scale-foreground"); |
88 | 88 | DEFSYM(hidden, "hidden"); |
89 | +DEFSYM(border_width, "border-width"); | |
90 | +DEFSYM(border_color, "border-color"); | |
89 | 91 | |
90 | 92 | static repv state_syms[fps_MAX]; |
91 | 93 |
@@ -215,6 +217,9 @@ fp_sweep (void) | ||
215 | 217 | height . PIXELS |
216 | 218 | width . PIXELS |
217 | 219 | |
220 | + border-width . NUMBER | |
221 | + border-color . COLOR | |
222 | + | |
218 | 223 | keymap . KEYMAP |
219 | 224 | cursor . CURSOR-OR-CURSOR-DEF |
220 | 225 |
@@ -338,11 +343,11 @@ set_frame_shapes (Lisp_Window *w, bool atomic) | ||
338 | 343 | XSetWindowAttributes wa; |
339 | 344 | int wamask; |
340 | 345 | wa.colormap = image_cmap; |
341 | - wa.border_pixel = BlackPixel (dpy, screen_num); | |
346 | + wa.border_pixel = w->border_pixel; | |
342 | 347 | wamask = CWColormap | CWBorderPixel; |
343 | 348 | shape_win = XCreateWindow (dpy, root_window, -100, -100, |
344 | 349 | w->frame_width, w->frame_height, |
345 | - 0, image_depth, InputOutput, | |
350 | + w->border_width, image_depth, InputOutput, | |
346 | 351 | image_visual, wamask, &wa); |
347 | 352 | } |
348 | 353 | else |
@@ -1246,6 +1251,26 @@ build_frame_part (struct frame_part *fp) | ||
1246 | 1251 | else |
1247 | 1252 | fp->renderer = Qnil; |
1248 | 1253 | |
1254 | + /* get border width */ | |
1255 | + tem = get_integer_prop (fp, Qborder_width, class_elt, ov_class_elt); | |
1256 | + if (tem != Qnil) { | |
1257 | + w->border_width = rep_INT(tem); | |
1258 | + } | |
1259 | + | |
1260 | + /* get border color */ | |
1261 | + tem = fp_assq (fp, Qborder_color, class_elt, ov_class_elt); | |
1262 | + if (tem != Qnil) | |
1263 | + { | |
1264 | + tem = rep_CDR(tem); | |
1265 | + if (Ffunctionp (tem) != Qnil) | |
1266 | + tem = call_protectedly_1 (tem, rep_VAL (w), Qnil); | |
1267 | + if (!COLORP(tem) && tem != Qnil) | |
1268 | + tem = call_protectedly (get_color, tem, Qnil); | |
1269 | + if (COLORP(tem)) { | |
1270 | + w->border_pixel = VCOLOR(tem)->pixel; | |
1271 | + } | |
1272 | + } | |
1273 | + | |
1249 | 1274 | /* get background images or colors */ |
1250 | 1275 | if (!get_pattern_prop (fp, fp->bg, get_color, |
1251 | 1276 | Qbackground, class_elt, ov_class_elt)) |
@@ -1487,6 +1512,10 @@ list_frame_generator (Lisp_Window *w) | ||
1487 | 1512 | |
1488 | 1513 | rep_PUSHGC(gc_win, win); |
1489 | 1514 | |
1515 | + /* clear window border */ | |
1516 | + w->border_width = 0; | |
1517 | + w->border_pixel = BlackPixel (dpy, screen_num); | |
1518 | + | |
1490 | 1519 | /* construct the component list, and find the bounding box */ |
1491 | 1520 | |
1492 | 1521 | /* if w->destroy_frame is set then we're rebuilding an existing |
@@ -1581,12 +1610,12 @@ list_frame_generator (Lisp_Window *w) | ||
1581 | 1610 | |
1582 | 1611 | wa.override_redirect = True; |
1583 | 1612 | wa.colormap = colormap; |
1584 | - wa.border_pixel = BlackPixel (dpy, screen_num); | |
1613 | + wa.border_pixel = w->border_pixel; | |
1585 | 1614 | wa.save_under = w->attr.save_under; |
1586 | 1615 | wamask = CWOverrideRedirect | CWColormap | CWBorderPixel | CWSaveUnder; |
1587 | 1616 | |
1588 | 1617 | w->frame = XCreateWindow (dpy, root_window, w->attr.x, w->attr.y, |
1589 | - w->frame_width, w->frame_height, 0, | |
1618 | + w->frame_width, w->frame_height, w->border_width, | |
1590 | 1619 | depth, InputOutput, visual, wamask, &wa); |
1591 | 1620 | } |
1592 | 1621 | else |
@@ -1595,6 +1624,8 @@ list_frame_generator (Lisp_Window *w) | ||
1595 | 1624 | w->attr.x += w->frame_x - old_x_off; |
1596 | 1625 | w->attr.y += w->frame_y - old_y_off; |
1597 | 1626 | |
1627 | + XSetWindowBorder (dpy, w->frame, w->border_pixel); | |
1628 | + XSetWindowBorderWidth (dpy, w->frame, w->border_width); | |
1598 | 1629 | XMoveResizeWindow (dpy, w->frame, w->attr.x, w->attr.y, |
1599 | 1630 | w->frame_width, w->frame_height); |
1600 | 1631 |
@@ -1966,6 +1997,8 @@ frames_init (void) | ||
1966 | 1997 | rep_INTERN(below_client); |
1967 | 1998 | rep_INTERN(scale_foreground); |
1968 | 1999 | rep_INTERN(hidden); |
2000 | + rep_INTERN(border_width); | |
2001 | + rep_INTERN(border_color); | |
1969 | 2002 | |
1970 | 2003 | rep_INTERN_SPECIAL(frame_part_classes); |
1971 | 2004 | rep_INTERN_SPECIAL(override_frame_part_classes); |
@@ -142,6 +142,9 @@ typedef struct lisp_window { | ||
142 | 142 | But the position is the position of the frame, while the |
143 | 143 | dimensions are those of the client */ |
144 | 144 | XWindowAttributes attr; |
145 | + unsigned int old_border_width; /* saved border width of window */ | |
146 | + unsigned int border_width; | |
147 | + unsigned long border_pixel; | |
145 | 148 | XSizeHints hints; |
146 | 149 | XWMHints *wmhints; |
147 | 150 | Window *cmap_windows; |
@@ -458,6 +458,7 @@ add_window (Window id) | ||
458 | 458 | w->name = rep_null_string (); |
459 | 459 | w->net_name = Qnil; |
460 | 460 | w->net_icon_name = Qnil; |
461 | + w->border_pixel = BlackPixel (dpy, screen_num); | |
461 | 462 | |
462 | 463 | /* Don't garbage collect the window before we are done. */ |
463 | 464 | /* Note: must not return without rep_POPGC. */ |
@@ -473,6 +474,7 @@ add_window (Window id) | ||
473 | 474 | XGetWindowAttributes (dpy, id, &w->attr); |
474 | 475 | DB((" orig: width=%d height=%d x=%d y=%d\n", |
475 | 476 | w->attr.width, w->attr.height, w->attr.x, w->attr.y)); |
477 | + w->old_border_width = w->attr.border_width; | |
476 | 478 | |
477 | 479 | get_window_name(w); |
478 | 480 |
@@ -599,7 +601,7 @@ remove_window (Lisp_Window *w, bool destroyed, bool from_error) | ||
599 | 601 | remove_window_frame (w); |
600 | 602 | |
601 | 603 | /* Restore original border width of the client */ |
602 | - XSetWindowBorderWidth (dpy, w->id, w->attr.border_width); | |
604 | + XSetWindowBorderWidth (dpy, w->id, w->old_border_width); | |
603 | 605 | } |
604 | 606 | |
605 | 607 | if (!from_error) |
@@ -960,8 +962,8 @@ surrounding WINDOW. | ||
960 | 962 | rep_DECLARE1(win, WINDOWP); |
961 | 963 | if (VWIN(win)->reparented) |
962 | 964 | { |
963 | - return Fcons (rep_MAKE_INT(VWIN(win)->frame_width), | |
964 | - rep_MAKE_INT(VWIN(win)->frame_height)); | |
965 | + return Fcons (rep_MAKE_INT(VWIN(win)->frame_width + 2*VWIN(win)->border_width), | |
966 | + rep_MAKE_INT(VWIN(win)->frame_height + 2*VWIN(win)->border_width)); | |
965 | 967 | } |
966 | 968 | else |
967 | 969 | return Fwindow_dimensions (win); |
@@ -1269,7 +1271,7 @@ window-border-width WINDOW | ||
1269 | 1271 | ::end:: */ |
1270 | 1272 | { |
1271 | 1273 | rep_DECLARE1(win, WINDOWP); |
1272 | - return rep_MAKE_INT(VWIN(win)->attr.border_width); | |
1274 | + return rep_MAKE_INT(VWIN(win)->border_width); | |
1273 | 1275 | } |
1274 | 1276 | |
1275 | 1277 | DEFUN("window-size-hints", Fwindow_size_hints, Swindow_size_hints, |