diff options
author | fluxgen <fluxgen> | 2003-08-27 14:04:12 (GMT) |
---|---|---|
committer | fluxgen <fluxgen> | 2003-08-27 14:04:12 (GMT) |
commit | b039f2076e81db88768e3c1935988baaadcf374d (patch) | |
tree | a751448f535314ff9986124dfd67b4cbebae265f /util/fbrun/FbRun.cc | |
parent | f81055e4af3d73947734727b331ad84850b47100 (diff) | |
download | fluxbox-b039f2076e81db88768e3c1935988baaadcf374d.zip fluxbox-b039f2076e81db88768e3c1935988baaadcf374d.tar.bz2 |
using GContext and FbPixmap
Diffstat (limited to 'util/fbrun/FbRun.cc')
-rw-r--r-- | util/fbrun/FbRun.cc | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/util/fbrun/FbRun.cc b/util/fbrun/FbRun.cc index 701f985..f2ebbac 100644 --- a/util/fbrun/FbRun.cc +++ b/util/fbrun/FbRun.cc | |||
@@ -19,7 +19,7 @@ | |||
19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | 19 | // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER |
20 | // DEALINGS IN THE SOFTWARE. | 20 | // DEALINGS IN THE SOFTWARE. |
21 | 21 | ||
22 | // $Id: FbRun.cc,v 1.18 2003/08/27 00:20:19 fluxgen Exp $ | 22 | // $Id: FbRun.cc,v 1.19 2003/08/27 14:04:12 fluxgen Exp $ |
23 | 23 | ||
24 | #include "FbRun.hh" | 24 | #include "FbRun.hh" |
25 | 25 | ||
@@ -55,13 +55,12 @@ FbRun::FbRun(int x, int y, size_t width): | |||
55 | m_font("fixed"), | 55 | m_font("fixed"), |
56 | m_display(FbTk::App::instance()->display()), | 56 | m_display(FbTk::App::instance()->display()), |
57 | m_bevel(4), | 57 | m_bevel(4), |
58 | m_gc(DefaultGC(m_display, DefaultScreen(m_display))), | 58 | m_gc(*this), |
59 | m_end(false), | 59 | m_end(false), |
60 | m_current_history_item(0), | 60 | m_current_history_item(0), |
61 | m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)), | 61 | m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) { |
62 | m_pixmap(0) { | 62 | |
63 | 63 | setGC(m_gc.gc()); | |
64 | setGC(m_gc); | ||
65 | setCursor(m_cursor); | 64 | setCursor(m_cursor); |
66 | // setting nomaximize in local resize | 65 | // setting nomaximize in local resize |
67 | resize(width, font().height() + m_bevel); | 66 | resize(width, font().height() + m_bevel); |
@@ -77,20 +76,23 @@ FbRun::FbRun(int x, int y, size_t width): | |||
77 | XFree(class_hint); | 76 | XFree(class_hint); |
78 | #ifdef HAVE_XPM | 77 | #ifdef HAVE_XPM |
79 | Pixmap mask = 0; | 78 | Pixmap mask = 0; |
79 | Pixmap pm; | ||
80 | XpmCreatePixmapFromData(m_display, | 80 | XpmCreatePixmapFromData(m_display, |
81 | window(), | 81 | window(), |
82 | fbrun_xpm, | 82 | fbrun_xpm, |
83 | &m_pixmap, | 83 | &pm, |
84 | &mask, | 84 | &mask, |
85 | 0); // attribs | 85 | 0); // attribs |
86 | if (mask != 0) | 86 | if (mask != 0) |
87 | XFreePixmap(m_display, mask); | 87 | XFreePixmap(m_display, mask); |
88 | |||
89 | m_pixmap = pm; | ||
88 | #endif // HAVE_XPM | 90 | #endif // HAVE_XPM |
89 | 91 | ||
90 | if (m_pixmap) { | 92 | if (m_pixmap.drawable()) { |
91 | XWMHints wmhints; | 93 | XWMHints wmhints; |
92 | wmhints.flags = IconPixmapHint; | 94 | wmhints.flags = IconPixmapHint; |
93 | wmhints.icon_pixmap = m_pixmap; | 95 | wmhints.icon_pixmap = m_pixmap.drawable(); |
94 | XSetWMHints(m_display, window(), &wmhints); | 96 | XSetWMHints(m_display, window(), &wmhints); |
95 | } | 97 | } |
96 | } | 98 | } |
@@ -98,8 +100,6 @@ FbRun::FbRun(int x, int y, size_t width): | |||
98 | 100 | ||
99 | FbRun::~FbRun() { | 101 | FbRun::~FbRun() { |
100 | hide(); | 102 | hide(); |
101 | if (m_pixmap != 0) | ||
102 | XFreePixmap(FbTk::App::instance()->display(), m_pixmap); | ||
103 | } | 103 | } |
104 | 104 | ||
105 | void FbRun::run(const std::string &command) { | 105 | void FbRun::run(const std::string &command) { |
@@ -187,7 +187,7 @@ bool FbRun::loadFont(const string &fontname) { | |||
187 | } | 187 | } |
188 | 188 | ||
189 | void FbRun::setForegroundColor(const FbTk::Color &color) { | 189 | void FbRun::setForegroundColor(const FbTk::Color &color) { |
190 | XSetForeground(m_display, m_gc, color.pixel()); | 190 | m_gc.setForeground(color); |
191 | } | 191 | } |
192 | 192 | ||
193 | void FbRun::setTitle(const string &title) { | 193 | void FbRun::setTitle(const string &title) { |