From: NeilBrown Date: Tue, 12 Jan 2016 02:34:39 +0000 (+1100) Subject: Remove old pane-text interface X-Git-Tag: lca2016~26 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=2283de23a8be2f4746b767ea8931b0da47e24e29;p=edlib.git Remove old pane-text interface No longer used. Signed-off-by: NeilBrown --- diff --git a/core-pane.c b/core-pane.c index 508bfd5e..10d1bf36 100644 --- a/core-pane.c +++ b/core-pane.c @@ -569,20 +569,6 @@ void pane_clear(struct pane *p, char *attrs) key_handle(&ci); } -void pane_text(struct pane *p, wchar_t ch, char *attrs, int x, int y) -{ - struct cmd_info ci = {0}; - - ci.key = "pane-text"; - ci.focus = p; - ci.x = x; - ci.y = y; - ci.str2 = attrs; - ci.extra = ch; - - key_handle(&ci); -} - char *pane_attr_get(struct pane *p, char *key) { struct pane *c; diff --git a/core.h b/core.h index a388d074..f256397f 100644 --- a/core.h +++ b/core.h @@ -350,7 +350,6 @@ void pane_set_numeric(struct pane *p, int numeric); void pane_set_extra(struct pane *p, int extra); struct pane *pane_attach(struct pane *p, char *type, struct pane *dp, char *arg); void pane_clear(struct pane *p, char *attrs); -void pane_text(struct pane *p, wchar_t ch, char *attrs, int x, int y); char *pane_attr_get(struct pane *p, char *key); char *pane_mark_attr(struct pane *p, struct mark *m, int forward, char *key); void pane_absxy(struct pane *p, int *x, int *y); diff --git a/display-ncurses.c b/display-ncurses.c index db541401..b1acb31b 100644 --- a/display-ncurses.c +++ b/display-ncurses.c @@ -139,11 +139,6 @@ DEF_CMD(ncurses_handle) ncurses_clear(ci->focus, attr, 0, 0, 0, 0); return 1; } - if (strcmp(ci->key, "pane-text") == 0) { - int attr = cvt_attrs(ci->str2); - ncurses_text(ci->focus, ci->extra, attr, ci->x, ci->y, 0); - return 1; - } if (strcmp(ci->key, "text-size") == 0) { int max_space = ci->numeric; int max_bytes = 0; diff --git a/python/display-pygtk.py b/python/display-pygtk.py index 7e6a3db9..59252b8a 100644 --- a/python/display-pygtk.py +++ b/python/display-pygtk.py @@ -28,17 +28,6 @@ class EdDisplay(gtk.Window): self.show() def handle(self, key, **a): - if key == "pane-text": - (x,y) = a["xy"] - c = a["extra"] - f = a["focus"] - if "str2" in a: - attr = a["str2"] - else: - attr = "" - pm = self.get_pixmap(f); - self.draw_char(pm, x, y, c, attr) - return True if key == "pane-clear": f = a["focus"] if "str2" in a: @@ -266,25 +255,6 @@ class EdDisplay(gtk.Window): self.pane.call_focus("Keystroke", self.pane, s) self.pane.refresh() - def draw_char(self, pm, x, y, c, attr): - t = self.text - if not self.gc: - self.gc = t.window.new_gc() - cmap = t.get_colormap() - self.gc.set_foreground(cmap.alloc_color(gtk.gdk.color_parse("blue"))) - if not self.bg: - self.bg = t.window.new_gc() - cmap = t.get_colormap() - self.bg.set_foreground(cmap.alloc_color(gtk.gdk.color_parse("lightyellow"))) - layout = t.create_pango_layout(unichr(c)) - bg = self.bg; fg = self.gc - if "inverse" in attr: - fg,bg = bg,fg - pm.draw_rectangle(bg, True, x, y, self.charwidth, self.lineheight) - pm.draw_layout(fg, x, y, layout) - t.queue_draw() - return False - def do_clear(self, pm, colour): t = self.text