- Keystroke-notify - string is the key name
- Mouse-event-notify - string is the event name
+
+# Displays
+
+A display pane provides linkage to keyboard/pointer input, and visual output.
+It will generate Keystroke and Mouse-event events for its parent, and expect
+various Draw: event from children.
+
+## Draw:clear
+
+Draw:clear will allocation a display image for the focus pane and clear it.
+"str1" can be attributes for the background, typically a background colour
+such as "bg:cyan". If no attributes are given and there is another pane
+close to the root which has been cleared, the appropriate section of the
+image for that pane is copied it the image for 'focus'. If ther is no
+image to copy from, the pane is cleared to "bg:white".
:H1:center,20,fg:blue,space-above:15,family:sans
:H2:center,15,fg:darkblue
-:background:color:bg:#b8c5cd,image-stretch:back.jpg,page-local
+:background:color:#b8c5cd,image-stretch:back.jpg,page-local
:scale:590x200
:P:left:30,12,family:sans
:bullet:fg:red,13
--------
A “display” is just a pane which can create an image somehow, and
-responds to commands like “pane-clear”, “text-display”, and
+responds to commands like “Draw:clear”, “text-display”, and
“image-display”. Displays are typically quite close to the root of the
“pane” tree, but this is not a requirement.
return c->content;
}
-
static int cvt_attrs(struct pane *p safe, struct pane *home safe,
const char *attrs)
{
DEF_CMD(nc_clear)
{
struct pane *p = ci->home;
- int attr = cvt_attrs(ci->focus, p, ci->str2?:ci->str);
+ int attr = cvt_attrs(ci->focus, p, ci->str);
PANEL *panel;
WINDOW *win;
int w, h;
key_add(nc_map, "Display:external-viewer", &nc_external_viewer);
key_add(nc_map, "Close", &nc_close);
key_add(nc_map, "Free", &edlib_do_free);
- key_add(nc_map, "pane-clear", &nc_clear);
+ key_add(nc_map, "Draw:clear", &nc_clear);
key_add(nc_map, "text-size", &nc_text_size);
key_add(nc_map, "Draw:text", &nc_draw_text);
key_add(nc_map, "Refresh:size", &nc_refresh_size);
{
struct mlinfo *mli = ci->home->data;
- call("pane-clear", mli->line, 0, NULL, "bg:white");
+ call("Draw:clear", mli->line, 0, NULL, "bg:white");
if (mli->message && !mli->modal &&
time(NULL) >= mli->last_message + 30) {
free(mli->message);
start = line_start = line;
if (dodraw)
- home_call(focus, "pane-clear", p);
+ home_call(focus, "Draw:clear", p);
if (strncmp(line, "<image:",7) == 0) {
/* For now an <image> must be on a line by itself.
if (vd->line_height <= 0)
return 1;
- call("pane-clear", p);
+ call("Draw:clear", p);
pm = call_ret(mark, "doc:point", ci->focus);
status = pane_attr_get(ci->focus, "status-line");
if (!status)
self.win.destroy()
return True
- def handle_clear(self, key, focus, str, str2, **a):
- "handle:pane-clear"
- attr = str2
- if attr is None:
- attr = str
+ def handle_clear(self, key, focus, str1, **a):
+ "handle:Draw:clear"
+ attr = str1
if attr is not None:
fg, bg, ul = self.get_colours(attr)
else:
for c in cmds:
rv = None
if c[:6] == 'color:':
- rv = focus.call('pane-clear', c[6:])
+ rv = focus.call('Draw:clear', 'bg:' + c[6:])
if c[:14] == "image-stretch:":
rv = focus.call('Draw:image', 1, "file:" + self.pathto(c[14:]))
if c[:6] == "image:":
m = vmark_first(focus, rl->typenum, p);
s = pane_attr_get(focus, "background");
if (s && strncmp(s, "call:", 5) == 0) {
- home_call(focus, "pane-clear", p);
+ home_call(focus, "Draw:clear", p);
home_call(focus, s+5, p, 0, m);
} else if (rl->background_drawn)
;
else if (!s)
- home_call(focus, "pane-clear", p);
+ home_call(focus, "Draw:clear", p);
else if (strncmp(s, "color:", 6) == 0) {
char *a = strdup(s);
strcpy(a, "bg:");
strcpy(a+3, s+6);
- home_call(focus, "pane-clear", p, 0, NULL, a);
+ home_call(focus, "Draw:clear", p, 0, NULL, a);
free(a);
} else if (strncmp(s, "image:", 6) == 0) {
- home_call(focus, "pane-clear", p);
+ home_call(focus, "Draw:clear", p);
home_call(focus, "Draw:image", p, 1, NULL, s+6);
} else
- home_call(focus, "pane-clear", p);
+ home_call(focus, "Draw:clear", p);
rl->background_drawn = True;
if (rl->header && vmark_is_valid(rl->header)) {
p->h - lineheight,
mwidth, lineheight);
- home_call(focus, "pane-clear", cp);
+ home_call(focus, "Draw:clear", cp);
home_call(focus, "Draw:text", cp, 0, NULL, " ",
scale.x, NULL, "",
0, lineheight-1);
Key "-o"
Display 80,30 1F8AF2793311FE2F2A762DBD463488EE 57,3
Key "-r"
-Display 80,30 30A8DFB0C9FB61828F3FF5A3DE98871C 58,3
+Display 80,30 6A84ED88C9ACDA55ACD36CD54B53C540 58,3
Key "-:"
-Display 80,30 A085A0961D482C14311C5E640FF33791 59,3
-Key "-b"
-Display 80,30 813CB8FA09176AD0CE6FDACEFDAF688C 60,3
-Key "-g"
-Display 80,30 C93D29F41B64EA3E87596A05A00A2351 61,3
-Key "-:"
-Display 80,30 41C2B28A8592D97BC8B14AD6B421ED1C 62,3
+Display 80,30 51C597208DD4A414A4AFE2A1A5094129 59,3
Key "-#"
-Display 80,30 0524ABBAF533D051EB2D029D913763B4 63,3
+Display 80,30 F36F71AD9F7D2FDC7DCB42599CADC86F 60,3
Key "-b"
-Display 80,30 87A17646A8AF6411C97F0C28CF05AFBB 64,3
+Display 80,30 903ACDE9CBFDBAB086B1AE2305B4EB3F 61,3
Key "-8"
-Display 80,30 3CCA2F0D775454090D5DB4F3033E0917 65,3
+Display 80,30 D2A407FA26421CB84B0CDA4F5D2ED41E 62,3
Key "-c"
-Display 80,30 30E3508BCB280906C39D0BFF779AE1C1 66,3
+Display 80,30 54BFC3BF5B34D5BF104BEDE0C794AFA4 63,3
Key "-5"
-Display 80,30 41856E5E7D1DFE48B484349F0D94DEB5 67,3
+Display 80,30 261A5D3E821E9932712037845C1B2EF7 64,3
Key "-c"
-Display 80,30 4803008525418FB5A3B7D06C28DCFF5D 68,3
+Display 80,30 96F6C9544F88E9AD92D14E2AA9AC6A48 65,3
Key "-d"
-Display 80,30 EE07419E01C92BCD8BB8EFFB1B2D068C 69,3
+Display 80,30 F22DB0A00EB5553F6CB8ADF7B3530F6B 66,3
Key "-,"
-Display 80,30 02066CCB40E54A15F08788C573F7519C 70,3
+Display 80,30 E88E2D6B962F3C862E310093B28D557A 67,3
Key ":C-D"
-Display 80,30 0DCB42F5714FFCA4CCB1F375AFF80F82 70,3
+Display 80,30 D294FC7BA1202D06CFB6AD98B1CD5F2B 67,3
Key ":A-<"
-Display 80,30 69A2BF53E432DC83E816B4867246A290 41,0
+Display 80,30 F2E0F92EF33DA2A3E6B5E7C963F90BB8 41,0
Key ":C-X"
-Display 80,30 EDFD4E1A58B100A708F273891DCE96E2 41,0
+Display 80,30 27D83ACE9F983650D3D30283B1D9A003 41,0
Key ":C-S"
-Display 80,30 46A7BDEAA04E8EA976CFA91D605BDEAE 41,0
+Display 80,30 6A0EA60D8101143E81B030368AA1A1C7 41,0
Key ":C-V"
-Display 80,30 D9822F1B9927F09A99B739D3CDF3E949 41,14
+Display 80,30 90808C66D076F7F6A9C135962F137EAE 41,14
Key ":C-V"
Display 80,30 08FE57104D15702DB7F960C95B5843B8 41,23
Key ":C-V"
Key "-o"
Display 80,30 8139E6415E6BA8ED807322973A462EC3 41,6
Key ":A-<"
-Display 80,30 97483E8ED6548D02F1CC29EB20FA29F5 41,0
+Display 80,30 F6EFCA04AF03776EAE8DC828399BC4A6 41,0
Key ":C-V"
-Display 80,30 FA6B6E9FBB2EDDCB022719C49FD2E4BF 41,14
+Display 80,30 0F80582BA5B1C2721F931D0657AF4D38 41,14
Key ":C-V"
Display 80,30 9BA759D549D1BCABD2E898BC8BF3949F 41,23
Key ":C-S"