// resource.hh for bbsmount - an tool for mounting in X11 // // Copyright (c) 2001 by Miroslav Jezbera, jezberam@phoenix.inf.upol.cz // // This program is free software; you can redistribute it and/or modify // it under the terms of the gnu general public license as published by // the free software foundation; either version 2 of the license, or // (at your option) any later version. // // this program is distributed in the hope that it will be useful, // but without any warranty; without even the implied warranty of // merchantability or fitness for a particular purpose. see the // gnu general public license for more details. // // you should have received a copy of the gnu general public license // along with this program; if not, write to the free software // foundation, inc., 675 mass ave, cambridge, ma 02139, usa. // // (see the included file copying / gpl-2.0) // #ifndef __RESOURCE_HH #define __RESOURCE_HH #include #include "bbsmount_base.hh" #include "bbsmount.hh" #include "Baseresource.hh" //#define BBTOOLS 1 //#define DEFAULT 2 //#define BLACKBOX 3 class BaseResource; struct FRAME { int width; int height; BTexture texture; int bevelWidth; }; struct TOOLTIP { BTexture texture; XFontStruct *font; XFontSet fontset; XFontSetExtents *fontset_extents; BColor textColor; BColor borderColor; int bevelWidth, borderWidth, timeout; }; struct POSITION { int x; int y; int mask; }; struct APP { unsigned int refresh_time; int rows, columns, row_height, column_width, button_padding; BTexture mount_texture; BTexture mount_texture_pressed; }; struct MOUNT_POINT { char * mount_point; int mounted_image, notmounted_image, actions_count; vector actions; bool can_eject, can_close; XpmImage mounted; XpmImage not_mounted; }; class Resource : public BaseResource { public: Resource(ToolWindow *); ~Resource(void); struct FRAME frame; struct POSITION position; struct APP app; struct MOUNT_POINT *mounts; struct TOOLTIP tooltip; int mounts_count; // New code const string &GetImagePrefix(void) const; const vector &GetMountPoints(void) const; const vector &GetCommands(void) const; const vector &getInfoTexts(void) const; const vector &GetImages(void) const; XFontSet &getTooltipFontSet(void) { return tooltip.fontset; } XFontSetExtents *getTooltipFontSetExtents(void) { return tooltip.fontset_extents; } XFontStruct *getTooltipFont(void) { return tooltip.font; } const BColor &getTooltipBorderColor(void) const { return tooltip.borderColor; } unsigned int getTooltipBorderWidth(void) const { return tooltip.borderWidth; } int getTooltipBevelWidth(void) const { return tooltip.bevelWidth; } int getTooltipTimeout(void) const { return tooltip.timeout; } const BColor &getTooltipFontColor(void) const { return tooltip.textColor; } BTexture *getTooltipTexture(void) { return &tooltip.texture; } void FreeAll(void); void MountPoints(void); protected: virtual void LoadBBToolResource(void); XFontSet Resource::createFontSet(const string &fontname); private: void Frame(void); void SizeAndPosition(void); void App(void); // void MountPoints(void); void ImagePrefix(void); void Tooltip(void); void CleanMounts(void); void Clean(void); // New code void LoadImages(void); void LoadCommands(void); void LoadInfoTexts(void); void LoadMountPoints(void); void LoadActions(const int mount_point); void LoadInfoText(const int mount_point); void GetModifiers(const string str, set &positive, set &negative) const; vector images; vector commands; vector infotexts; vector mount_points; string image_prefix; }; #endif /* __RESOURCE_HH */