• R/O
  • HTTP
  • SSH
  • HTTPS

Commit

Tags
No Tags

Frequently used words (click to add to your profile)

javac++androidlinuxc#windowsobjective-ccocoa誰得qtpythonphprubygameguibathyscaphec計画中(planning stage)翻訳omegatframeworktwitterdomtestvb.netdirectxゲームエンジンbtronarduinopreviewer

Japanese translation of message catalog for Sawfish Window-Manager


Commit MetaInfo

Revisão7edfb1c714c1049f9cfafe0b312bb61bc20437cd (tree)
Hora2010-05-24 00:18:53
AutorChristopher Roy Bratusek <zanghar@free...>
CommiterChristopher Roy Bratusek

Mensagem de Log

added border_with and border_color frame-part attributes

Mudança Sumário

Diff

--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
11 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]
38
49 2010-05-16 Christopher Bratusek <zanghar@freenet.de>
510 * src/display.c: allow compilation with -DDEBUG
--- a/man/news.texi
+++ b/man/news.texi
@@ -11,6 +11,15 @@ they occurred between. For more detailed information see the
1111
1212 @heading 1.6.4 "Frozen Flame"
1313
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+
1423 @heading 1.6.3 "Hava Nagila"
1524
1625 @itemize @bullet
--- a/man/sawfish.texi
+++ b/man/sawfish.texi
@@ -3630,6 +3630,12 @@ Defines the width of the frame part.
36303630 @item (height . @var{value})
36313631 Defines the height of the frame part.
36323632
3633+@item (border-width . @var{value})
3634+Defines window border width.
3635+
3636+@item (border-color . @var{value})
3637+Defines window border color.
3638+
36333639 @item (keymap . @var{value})
36343640 Defines the keymap to use when evaluating events originating in this
36353641 frame part.
@@ -3659,10 +3665,14 @@ frame part.
36593665 The values specified for the @code{background}, @code{foreground},
36603666 @code{render-scale}, @code{font}, @code{left-edge}, @code{right-edge},
36613667 @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.
36663676
36673677 The coordinate system used for specifying the part's position is
36683678 relative to the window edge that the position is defined against.
--- a/src/events.c
+++ b/src/events.c
@@ -1317,7 +1317,7 @@ send_synthetic_configure (Lisp_Window *w)
13171317 }
13181318 ev.xconfigure.width = w->attr.width;
13191319 ev.xconfigure.height = w->attr.height;
1320- ev.xconfigure.border_width = w->attr.border_width;
1320+ ev.xconfigure.border_width = w->border_width;
13211321 ev.xconfigure.above = w->reparented ? w->frame : root_window;
13221322 ev.xconfigure.override_redirect = False;
13231323 XSendEvent (dpy, w->id, False, StructureNotifyMask, &ev);
--- a/src/frames.c
+++ b/src/frames.c
@@ -86,6 +86,8 @@ DEFSYM(override_frame_part_classes, "override-frame-part-classes");
8686 DEFSYM(below_client, "below-client");
8787 DEFSYM(scale_foreground, "scale-foreground");
8888 DEFSYM(hidden, "hidden");
89+DEFSYM(border_width, "border-width");
90+DEFSYM(border_color, "border-color");
8991
9092 static repv state_syms[fps_MAX];
9193
@@ -215,6 +217,9 @@ fp_sweep (void)
215217 height . PIXELS
216218 width . PIXELS
217219
220+ border-width . NUMBER
221+ border-color . COLOR
222+
218223 keymap . KEYMAP
219224 cursor . CURSOR-OR-CURSOR-DEF
220225
@@ -338,11 +343,11 @@ set_frame_shapes (Lisp_Window *w, bool atomic)
338343 XSetWindowAttributes wa;
339344 int wamask;
340345 wa.colormap = image_cmap;
341- wa.border_pixel = BlackPixel (dpy, screen_num);
346+ wa.border_pixel = w->border_pixel;
342347 wamask = CWColormap | CWBorderPixel;
343348 shape_win = XCreateWindow (dpy, root_window, -100, -100,
344349 w->frame_width, w->frame_height,
345- 0, image_depth, InputOutput,
350+ w->border_width, image_depth, InputOutput,
346351 image_visual, wamask, &wa);
347352 }
348353 else
@@ -1246,6 +1251,26 @@ build_frame_part (struct frame_part *fp)
12461251 else
12471252 fp->renderer = Qnil;
12481253
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+
12491274 /* get background images or colors */
12501275 if (!get_pattern_prop (fp, fp->bg, get_color,
12511276 Qbackground, class_elt, ov_class_elt))
@@ -1487,6 +1512,10 @@ list_frame_generator (Lisp_Window *w)
14871512
14881513 rep_PUSHGC(gc_win, win);
14891514
1515+ /* clear window border */
1516+ w->border_width = 0;
1517+ w->border_pixel = BlackPixel (dpy, screen_num);
1518+
14901519 /* construct the component list, and find the bounding box */
14911520
14921521 /* if w->destroy_frame is set then we're rebuilding an existing
@@ -1581,12 +1610,12 @@ list_frame_generator (Lisp_Window *w)
15811610
15821611 wa.override_redirect = True;
15831612 wa.colormap = colormap;
1584- wa.border_pixel = BlackPixel (dpy, screen_num);
1613+ wa.border_pixel = w->border_pixel;
15851614 wa.save_under = w->attr.save_under;
15861615 wamask = CWOverrideRedirect | CWColormap | CWBorderPixel | CWSaveUnder;
15871616
15881617 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,
15901619 depth, InputOutput, visual, wamask, &wa);
15911620 }
15921621 else
@@ -1595,6 +1624,8 @@ list_frame_generator (Lisp_Window *w)
15951624 w->attr.x += w->frame_x - old_x_off;
15961625 w->attr.y += w->frame_y - old_y_off;
15971626
1627+ XSetWindowBorder (dpy, w->frame, w->border_pixel);
1628+ XSetWindowBorderWidth (dpy, w->frame, w->border_width);
15981629 XMoveResizeWindow (dpy, w->frame, w->attr.x, w->attr.y,
15991630 w->frame_width, w->frame_height);
16001631
@@ -1966,6 +1997,8 @@ frames_init (void)
19661997 rep_INTERN(below_client);
19671998 rep_INTERN(scale_foreground);
19681999 rep_INTERN(hidden);
2000+ rep_INTERN(border_width);
2001+ rep_INTERN(border_color);
19692002
19702003 rep_INTERN_SPECIAL(frame_part_classes);
19712004 rep_INTERN_SPECIAL(override_frame_part_classes);
--- a/src/sawfish.h
+++ b/src/sawfish.h
@@ -142,6 +142,9 @@ typedef struct lisp_window {
142142 But the position is the position of the frame, while the
143143 dimensions are those of the client */
144144 XWindowAttributes attr;
145+ unsigned int old_border_width; /* saved border width of window */
146+ unsigned int border_width;
147+ unsigned long border_pixel;
145148 XSizeHints hints;
146149 XWMHints *wmhints;
147150 Window *cmap_windows;
--- a/src/windows.c
+++ b/src/windows.c
@@ -458,6 +458,7 @@ add_window (Window id)
458458 w->name = rep_null_string ();
459459 w->net_name = Qnil;
460460 w->net_icon_name = Qnil;
461+ w->border_pixel = BlackPixel (dpy, screen_num);
461462
462463 /* Don't garbage collect the window before we are done. */
463464 /* Note: must not return without rep_POPGC. */
@@ -473,6 +474,7 @@ add_window (Window id)
473474 XGetWindowAttributes (dpy, id, &w->attr);
474475 DB((" orig: width=%d height=%d x=%d y=%d\n",
475476 w->attr.width, w->attr.height, w->attr.x, w->attr.y));
477+ w->old_border_width = w->attr.border_width;
476478
477479 get_window_name(w);
478480
@@ -599,7 +601,7 @@ remove_window (Lisp_Window *w, bool destroyed, bool from_error)
599601 remove_window_frame (w);
600602
601603 /* 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);
603605 }
604606
605607 if (!from_error)
@@ -960,8 +962,8 @@ surrounding WINDOW.
960962 rep_DECLARE1(win, WINDOWP);
961963 if (VWIN(win)->reparented)
962964 {
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));
965967 }
966968 else
967969 return Fwindow_dimensions (win);
@@ -1269,7 +1271,7 @@ window-border-width WINDOW
12691271 ::end:: */
12701272 {
12711273 rep_DECLARE1(win, WINDOWP);
1272- return rep_MAKE_INT(VWIN(win)->attr.border_width);
1274+ return rep_MAKE_INT(VWIN(win)->border_width);
12731275 }
12741276
12751277 DEFUN("window-size-hints", Fwindow_size_hints, Swindow_size_hints,