8 #include <yui/Libyui_config.h>
10 #define YUILogComponent "gtk"
11 #include <yui/YUILog.h>
12 #include <yui/YSimpleEventHandler.h>
17 #define RET(a) { return (a); }
22 YGUI (
bool with_threads);
25 static YGUI *ui() {
return (
YGUI *) YUI::ui(); }
28 virtual YWidgetFactory *createWidgetFactory();
29 virtual YOptionalWidgetFactory *createOptionalWidgetFactory();
30 virtual YApplication *createApplication();
33 static void setTextdomain (
const char *domain);
35 virtual void idleLoop (
int fd_ycp);
37 YEvent *waitInput (
unsigned long timeout_ms,
bool block);
39 virtual YEvent *runPkgSelection (YWidget *packageSelector);
44 void makeScreenShot();
49 void toggleRecordMacro();
54 YSimpleEventHandler m_event_handler;
55 void sendEvent (YEvent *event);
56 YEvent *pendingEvent()
const {
return m_event_handler.pendingEvent(); }
57 bool eventPendingFor (YWidget *widget)
const
58 {
return m_event_handler.eventPendingFor (widget); }
63 static gboolean busy_timeout_cb (gpointer data);
66 bool m_no_border, m_fullscreen, m_swsingle;
70 bool setFullscreen()
const {
return m_fullscreen; }
71 bool unsetBorder()
const {
return m_no_border; }
72 bool isSwsingle()
const {
return m_swsingle; }
75 #include <YWidgetFactory.h>
79 virtual YDialog *createDialog (YDialogType dialogType, YDialogColorMode colorMode);
81 virtual YPushButton *createPushButton (YWidget *parent,
const std::string &label);
82 virtual YLabel *createLabel (YWidget *parent,
const std::string &text,
bool isHeading,
bool isOutputField);
83 virtual YInputField *createInputField (YWidget *parent,
const std::string &label,
bool passwordMode);
84 virtual YCheckBox *createCheckBox (YWidget *parent,
const std::string &label,
bool isChecked);
85 virtual YRadioButton *createRadioButton (YWidget *parent,
const std::string &label,
bool isChecked);
86 virtual YComboBox *createComboBox (YWidget *parent,
const std::string & label,
bool editable);
87 virtual YSelectionBox *createSelectionBox (YWidget *parent,
const std::string &label);
88 virtual YTree *createTree (YWidget *parent,
const std::string &label,
bool multiselection,
bool recursiveSelection);
89 virtual YTable *createTable (YWidget *parent, YTableHeader *headers,
bool multiSelection);
90 virtual YProgressBar *createProgressBar (YWidget *parent,
const std::string &label,
int maxValue);
91 virtual YBusyIndicator *createBusyIndicator (YWidget *parent,
const std::string &label,
int timeout);
92 virtual YRichText *createRichText (YWidget *parent,
const std::string &text,
bool plainTextMode);
94 virtual YIntField *createIntField (YWidget *parent,
const std::string &label,
int minVal,
int maxVal,
int initialVal);
95 virtual YMenuButton *createMenuButton (YWidget *parent,
const std::string &label);
96 virtual YMultiLineEdit *createMultiLineEdit (YWidget *parent,
const std::string &label);
97 virtual YImage *createImage (YWidget *parent,
const std::string &imageFileName,
bool animated);
98 virtual YLogView *createLogView (YWidget *parent,
const std::string &label,
int visibleLines,
int storedLines);
99 virtual YMultiSelectionBox *createMultiSelectionBox (YWidget *parent,
const std::string &label);
101 virtual YPackageSelector *createPackageSelector (YWidget * parent,
long ModeFlags);
102 virtual YWidget *createPkgSpecial (YWidget * parent,
const std::string & subwidgetName) RET (NULL)
104 virtual YLayoutBox *createLayoutBox (YWidget *parent, YUIDimension dimension);
105 virtual YButtonBox *createButtonBox (YWidget *parent);
107 virtual YSpacing *createSpacing (YWidget *parent, YUIDimension dim,
bool stretchable, YLayoutSize_t size);
108 virtual YEmpty *createEmpty (YWidget *parent);
109 virtual YAlignment *createAlignment (YWidget *parent, YAlignmentType horAlignment, YAlignmentType vertAlignment);
110 virtual YSquash *createSquash (YWidget *parent,
bool horSquash,
bool vertSquash);
112 virtual YFrame *createFrame (YWidget *parent,
const std::string &label);
113 virtual YCheckBoxFrame *createCheckBoxFrame (YWidget *parent,
const std::string &label,
bool checked);
115 virtual YRadioButtonGroup *createRadioButtonGroup (YWidget *parent);
116 virtual YReplacePoint *createReplacePoint (YWidget *parent);
119 #include <YOptionalWidgetFactory.h>
124 virtual bool hasWizard() RET (
true)
125 virtual YWizard *createWizard (YWidget *parent,
const std::string &backButtonLabel,
126 const std::string &abortButtonLabel,
const std::string &nextButtonLabel,
127 YWizardMode wizardMode);
129 virtual bool hasDumbTab() RET (
true)
130 virtual YDumbTab *createDumbTab (YWidget *parent);
132 virtual bool hasSlider() RET (
true)
133 virtual YSlider *createSlider (YWidget *parent,
const std::string &label,
int minVal,
134 int maxVal,
int initialVal);
136 virtual bool hasDateField() RET (
true)
137 virtual YDateField *createDateField (YWidget *parent,
const std::string &label);
139 virtual bool hasTimeField() RET (
true)
140 virtual YTimeField *createTimeField (YWidget *parent,
const std::string &label);
142 virtual bool hasTimezoneSelector() RET (
true)
143 virtual YTimezoneSelector *createTimezoneSelector (YWidget *parent,
144 const std::string &pixmap,
const std::map <std::string, std::string> &timezones);
146 virtual bool hasBarGraph() RET (
true)
147 virtual YBarGraph *createBarGraph (YWidget *parent);
149 virtual bool hasMultiProgressMeter() RET (
true)
150 virtual YMultiProgressMeter *createMultiProgressMeter (YWidget *parent,
151 YUIDimension dim,
const std::vector<float> &maxValues);
153 virtual bool hasPartitionSplitter() RET (
true)
154 virtual YPartitionSplitter *createPartitionSplitter (YWidget *parent,
155 int usedSize,
int totalFreeSize,
int newPartSize,
int minNewPartSize,
156 int minFreeSize,
const std::string &usedLabel,
const std::string &freeLabel,
157 const std::string &newPartLabel,
const std::string &freeFieldLabel,
158 const std::string &newPartFieldLabel);
160 virtual bool hasDownloadProgress() RET (
true)
161 virtual YDownloadProgress *createDownloadProgress (YWidget *parent,
162 const std::string &label,
const std::string & filename, YFileSize_t expectedFileSize);
164 virtual bool hasContextMenu() RET (
true)
166 virtual bool hasSimplePatchSelector() RET (
true)
167 virtual YWidget *createSimplePatchSelector (YWidget *parent,
long modeFlags);
168 virtual bool hasPatternSelector() RET (
true)
169 virtual YWidget *createPatternSelector (YWidget *parent,
long modeFlags);
172 #include <YApplication.h>
179 virtual std::string glyph (
const std::string &symbolName);
181 virtual std::string askForExistingDirectory (
const std::string &startDir,
182 const std::string &headline);
183 virtual std::string askForExistingFile (
const std::string &startWith,
184 const std::string &filter,
const std::string &headline);
185 virtual std::string askForSaveFileName (
const std::string &startWith,
186 const std::string &filter,
const std::string &headline);
188 virtual void busyCursor() { YGUI::ui()->busyCursor(); }
189 virtual void normalCursor() { YGUI::ui()->normalCursor(); }
191 virtual void makeScreenShot (
const std::string &filename);
194 virtual int deviceUnits (YUIDimension dim,
float layout_units);
195 virtual float layoutUnits (YUIDimension dim,
int device_units);
197 virtual int displayWidth();
198 virtual int displayHeight();
199 virtual int displayDepth();
200 virtual long displayColors();
201 virtual int defaultWidth();
202 virtual int defaultHeight();
204 virtual bool isTextMode() RET (
false)
205 virtual bool leftHandedMouse() RET (
false)
206 virtual bool hasImageSupport() RET (
true)
207 virtual bool hasLocalImageSupport() RET (
true)
208 virtual bool hasAnimationSupport() RET (
true)
209 virtual bool hasIconSupport() RET (
true)
210 virtual bool hasFullUtf8Support() RET (
true)
212 virtual bool richTextSupportsTable() RET (
true)
214 virtual bool richTextSupportsTable() RET (
false)
217 virtual bool openContextMenu (
const YItemCollection &itemCollection);
221 std::map <std::string, int> screenShotNb;
222 std::string screenShotNameTemplate;