summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrcyeske <rcyeske>2001-02-19 20:46:23 +0000
committerrcyeske <rcyeske>2001-02-19 20:46:23 +0000
commit00b2a53044161c0882601ddf46864c7dcc062f76 (patch)
tree9ca2da2ca7b0ac9abba43d17e53d4830465d7ce6
parent74f06e31b48eb29f7fa171b0aa14fdf30ace0f18 (diff)
downloadratpoison-00b2a53044161c0882601ddf46864c7dcc062f76.zip
added message macro and marked_message()
-rw-r--r--src/bar.c6
-rw-r--r--src/bar.h4
2 files changed, 6 insertions, 4 deletions
diff --git a/src/bar.c b/src/bar.c
index 24380e8..16bc8e3 100644
--- a/src/bar.c
+++ b/src/bar.c
@@ -136,11 +136,11 @@ update_window_names (screen_info *s)
sbuf_copy (bar_buffer, MESSAGE_NO_MANAGED_WINDOWS);
}
- message (sbuf_get (bar_buffer), mark_start, mark_end);
+ marked_message (sbuf_get (bar_buffer), mark_start, mark_end);
}
void
-message (char *msg, int mark_start, int mark_end)
+marked_message (char *msg, int mark_start, int mark_end)
{
XGCValues lgv;
GC lgc;
@@ -186,7 +186,7 @@ message (char *msg, int mark_start, int mark_end)
assert (mark_start <= strlen(msg) + 1);
assert (mark_end <= strlen(msg) + 1);
- start = XTextWidth (s->font, msg, mark_start);
+ start = XTextWidth (s->font, msg, mark_start) + BAR_X_PADDING;
end = XTextWidth (s->font, msg + mark_start, mark_end - mark_start);
PRINT_DEBUG ("%d %d strlen(%d)==> %d %d\n", mark_start, mark_end, strlen(msg), start, end);
diff --git a/src/bar.h b/src/bar.h
index 088c7af..e98ccd8 100644
--- a/src/bar.h
+++ b/src/bar.h
@@ -27,6 +27,8 @@ int show_bar (screen_info *s);
int hide_bar (screen_info *s);
int bar_y (screen_info *s);
int bar_x (screen_info *s, int width);
-void message (char *msg, int hl_start, int hl_end);
+
+#define message(msg) marked_message (msg, 0, 0)
+void marked_message (char *msg, int hl_start, int hl_end);
#endif /* ! _RATPOISON_BAR_H */