_atoms[Atom_String] = XA_STRING;
_atoms[Atom_Utf8] = create("UTF8_STRING");
-#ifdef HAVE_GETPID
_atoms[openbox_pid] = create("_OPENBOX_PID");
-#endif // HAVE_GETPID
_atoms[wm_colormap_windows] = create("WM_COLORMAP_WINDOWS");
_atoms[wm_protocols] = create("WM_PROTOCOLS");
*/
Atom OBProperty::create(const char *name) const
{
- return XInternAtom(OBDisplay::display, name, False);
+ Atom a = XInternAtom(OBDisplay::display, name, False);
+ assert(a);
+ return a;
}
Atom_String, //!< The atom which represents ascii strings
Atom_Utf8, //!< The atom which represents utf8-encoded strings
-#ifdef HAVE_GETPID
openbox_pid,
-#endif // HAVE_GETPID
// window hints
wm_colormap_windows,
private:
//! The value of all atoms on the X server that exist in the
//! OBProperty::Atoms enum
- Atom _atoms[NUM_ATOMS];
+ Atom _atoms[NUM_ATOMS];
//! Gets the value of an Atom from the X server, creating it if nessesary
Atom create(const char *name) const;
{
}
-Style::Style(unsigned int screen)
- : font(0), screen_number(screen)
-{
-}
-
-Style::Style(unsigned int screen, BImageControl *ctrl)
- : image_control(ctrl), font(0), screen_number(screen)
+Style::Style(BImageControl *ctrl)
+ : image_control(ctrl), font(0),
+ screen_number(ctrl->getScreenInfo()->getScreenNumber())
{
}
stick_button.mask = None;
}
-void Style::load(Configuration &style) {
+void Style::load(const Configuration &style) {
std::string s;
// load fonts/fontsets
return b;
delete b;
}
-
+
+ if (style.getValue(rbasename + "xft.font", s))
+ printf("Unable to load font \"%s\". Exiting\n", s.c_str());
+ else
+ printf("Font not defined by style. Exiting\n");
exit(2); // can't continue without a font
}
public:
Style();
- Style(unsigned int);
- Style(unsigned int, BImageControl *);
+ Style(BImageControl *);
~Style();
void doJustify(const std::string &text, int &start_pos,
BFont *readDatabaseFont(const std::string &rbasename,
const Configuration &style);
- void load(Configuration &);
+ void load(const Configuration &style);
inline BColor *getBorderColor(void) { return &border_color; }
inline const BTexture &getFrameFocus() const { return f_focus; }
inline const BTexture &getFrameUnfocus() const { return f_unfocus; }
- inline void setImageControl(BImageControl *c) { image_control = c; }
- inline void setScreenNumber(unsigned int scr) { screen_number = scr; }
+ inline void setImageControl(BImageControl *c) {
+ image_control = c;
+ screen_number = c->getScreenInfo()->getScreenNumber();
+ }
inline unsigned int getScreen(void) { return screen_number; }
// XXX add inline accessors for the rest of the bummy