all repos — fluxbox @ b039f2076e81db88768e3c1935988baaadcf374d

custom fork of the fluxbox windowmanager

using GContext and FbPixmap
fluxgen fluxgen
commit

b039f2076e81db88768e3c1935988baaadcf374d

parent

f81055e4af3d73947734727b331ad84850b47100

2 files changed, 21 insertions(+), 19 deletions(-)

jump to
M util/fbrun/FbRun.ccutil/fbrun/FbRun.cc

@@ -19,7 +19,7 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbRun.cc,v 1.18 2003/08/27 00:20:19 fluxgen Exp $ +// $Id: FbRun.cc,v 1.19 2003/08/27 14:04:12 fluxgen Exp $ #include "FbRun.hh"

@@ -55,13 +55,12 @@ m_font, ""),

m_font("fixed"), m_display(FbTk::App::instance()->display()), m_bevel(4), - m_gc(DefaultGC(m_display, DefaultScreen(m_display))), + m_gc(*this), m_end(false), m_current_history_item(0), - m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)), - m_pixmap(0) { - - setGC(m_gc); + m_cursor(XCreateFontCursor(FbTk::App::instance()->display(), XC_xterm)) { + + setGC(m_gc.gc()); setCursor(m_cursor); // setting nomaximize in local resize resize(width, font().height() + m_bevel);

@@ -77,20 +76,23 @@

XFree(class_hint); #ifdef HAVE_XPM Pixmap mask = 0; + Pixmap pm; XpmCreatePixmapFromData(m_display, window(), fbrun_xpm, - &m_pixmap, + &pm, &mask, 0); // attribs if (mask != 0) XFreePixmap(m_display, mask); + + m_pixmap = pm; #endif // HAVE_XPM - if (m_pixmap) { + if (m_pixmap.drawable()) { XWMHints wmhints; wmhints.flags = IconPixmapHint; - wmhints.icon_pixmap = m_pixmap; + wmhints.icon_pixmap = m_pixmap.drawable(); XSetWMHints(m_display, window(), &wmhints); } }

@@ -98,8 +100,6 @@

FbRun::~FbRun() { hide(); - if (m_pixmap != 0) - XFreePixmap(FbTk::App::instance()->display(), m_pixmap); } void FbRun::run(const std::string &command) {

@@ -187,7 +187,7 @@ return true;

} void FbRun::setForegroundColor(const FbTk::Color &color) { - XSetForeground(m_display, m_gc, color.pixel()); + m_gc.setForeground(color); } void FbRun::setTitle(const string &title) {
M util/fbrun/FbRun.hhutil/fbrun/FbRun.hh

@@ -19,15 +19,17 @@ // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING

// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER // DEALINGS IN THE SOFTWARE. -// $Id: FbRun.hh,v 1.13 2003/08/27 00:19:57 fluxgen Exp $ +// $Id: FbRun.hh,v 1.14 2003/08/27 14:04:12 fluxgen Exp $ #ifndef FBRUN_HH #define FBRUN_HH -#include "EventHandler.hh" -#include "Font.hh" -#include "FbWindow.hh" -#include "TextBox.hh" +#include "FbTk/EventHandler.hh" +#include "FbTk/Font.hh" +#include "FbTk/FbWindow.hh" +#include "FbTk/TextBox.hh" +#include "FbTk/GContext.hh" +#include "FbTk/FbPixmap.hh" #include <string> #include <vector>

@@ -84,14 +86,14 @@

FbTk::Font m_font; ///< font used to draw command text Display *m_display; ///< display connection int m_bevel; - GC m_gc; ///< graphic context + FbTk::GContext m_gc; ///< graphic context bool m_end; ///< marks when this object is done std::vector<std::string> m_history; ///< history list of commands size_t m_current_history_item; ///< holds current position in command history std::string m_history_file; ///< holds filename for command history file Cursor m_cursor; - Pixmap m_pixmap; + FbTk::FbPixmap m_pixmap; }; #endif // FBRUN_HH