Author: rpmcruz
Date: Tue Feb 5 04:44:22 2008
New Revision: 44146
URL: http://svn.opensuse.org/viewcvs/yast?rev=44146&view=rev
Log:
* src/YGUI.h/.cc: libyui sync: moved glyph() from YUI to YApplication.
* src/YGDialog.h/.cc: fixed new open/activate().
Modified:
trunk/gtk/ChangeLog
trunk/gtk/src/YGDialog.cc
trunk/gtk/src/YGDialog.h
trunk/gtk/src/YGUI.cc
trunk/gtk/src/YGUI.h
Modified: trunk/gtk/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/ChangeLog?rev=44146&r1=44145&r2=44146&view=diff
==============================================================================
--- trunk/gtk/ChangeLog (original)
+++ trunk/gtk/ChangeLog Tue Feb 5 04:44:22 2008
@@ -1,3 +1,13 @@
+2008-02-05 Ricardo Cruz
+
+ * src/YGUI.h/.cc: libyui sync: moved glyph() from YUI to YApplication.
+
+ * src/YGDialog.h/.cc: fixed new open/activate().
+
+2008-02-03 Stephan Kulow
+
+ * src/YGUI.cc/h: libyui sync.
+
2008-02-03 Ricardo Cruz
* src/yzyppwrapper.cc: bug fix: licenses were being rejected regardless
Modified: trunk/gtk/src/YGDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.cc?rev=44146&r1=44145&r2=44146&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.cc (original)
+++ trunk/gtk/src/YGDialog.cc Tue Feb 5 04:44:22 2008
@@ -100,9 +100,6 @@
void show()
{ gtk_widget_show (m_widget); }
- void present()
- { gtk_window_present (GTK_WINDOW (m_widget)); }
-
void normalCursor()
{
if (GTK_WIDGET_REALIZED (m_widget))
@@ -329,47 +326,14 @@
YGWindow::unref (m_window);
}
-void YGDialog::showWindow()
-{
- IMPL
- m_window->setChild (this);
- gtk_widget_show (m_window->getWidget());
- YGUI::ui()->busyCursor();
-}
-
-void YGDialog::hideWindow()
-{
- IMPL
- m_window->setChild (NULL);
- gtk_widget_hide (m_window->getWidget());
-}
-
-static list dialogs_stack;
-
-void YGUI::showDialog (YDialog *_dialog)
+void YGDialog::openInternal()
{
- IMPL
- YGDialog *dialog = static_cast (_dialog);
- if (dialog->dialogType() == YMainDialog)
- dialogs_stack.push_back (dialog);
- dialog->showWindow();
+ m_window->show();
}
-void YGUI::closeDialog (YDialog *_dialog)
+void YGDialog::activate()
{
- IMPL
- YGDialog *dialog = static_cast (_dialog);
- if (dialog->dialogType() == YMainDialog) {
- dialogs_stack.pop_back();
- if (!dialogs_stack.empty()) {
- YGDialog *old_dialog = dialogs_stack.back();
- old_dialog->showWindow();
- }
- else
- dialog->hideWindow();
- }
- else
- dialog->hideWindow();
+ m_window->setChild (this);
}
YGDialog *YGDialog::currentDialog()
@@ -444,16 +408,6 @@
return new YGDialog (dialogType, colorMode);
}
-void YGDialog::openInternal()
-{
- m_window->show();
-}
-
-void YGDialog::activate()
-{
- m_window->present();
-}
-
YEvent *YGDialog::waitForEventInternal (int timeout_millisec)
{ return YGUI::ui()->userInput (timeout_millisec); }
Modified: trunk/gtk/src/YGDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGDialog.h?rev=44146&r1=44145&r2=44146&view=diff
==============================================================================
--- trunk/gtk/src/YGDialog.h (original)
+++ trunk/gtk/src/YGDialog.h Tue Feb 5 04:44:22 2008
@@ -15,8 +15,6 @@
public:
YGDialog (YDialogType dialogType, YDialogColorMode colorMode);
virtual ~YGDialog();
- void showWindow();
- void hideWindow();
void setCloseCallback (YGWindowCloseFn closeCallback, void *closeData);
void unsetCloseCallback();
@@ -33,8 +31,8 @@
virtual int preferredWidth() { return 0; }
virtual int preferredHeight() { return 0; }
- virtual void activate();
virtual void openInternal();
+ virtual void activate();
virtual YEvent *waitForEventInternal (int timeout_millisec);
virtual YEvent *pollEventInternal();
Modified: trunk/gtk/src/YGUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.cc?rev=44146&r1=44145&r2=44146&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.cc (original)
+++ trunk/gtk/src/YGUI.cc Tue Feb 5 04:44:22 2008
@@ -105,6 +105,27 @@
}
}
+static inline GdkScreen *getScreen ()
+{ return gdk_display_get_default_screen (gdk_display_get_default()); }
+static int getDisplayWidth()
+{ return gdk_screen_get_width (getScreen()); }
+static int getDisplayHeight()
+{ return gdk_screen_get_height (getScreen()); }
+
+int YGUI::_getDefaultWidth()
+{
+ if (!m_default_size.width)
+ m_default_size.width = MIN (600, getDisplayWidth());
+ return m_default_size.width;
+}
+
+int YGUI::_getDefaultHeight()
+{
+ if (!m_default_size.height)
+ m_default_size.height = MIN (450, getDisplayHeight());
+ return m_default_size.height;
+}
+
//#define PRINT_EVENTS
static gboolean ycp_wakeup_fn (GIOChannel *source, GIOCondition condition,
@@ -205,41 +226,6 @@
g_main_context_wakeup (NULL);
}
-static inline GdkScreen *getScreen ()
-{ return gdk_display_get_default_screen (gdk_display_get_default()); }
-
-int YGUI::getDisplayWidth()
-{ return gdk_screen_get_width (getScreen()); }
-
-int YGUI::getDisplayHeight()
-{ return gdk_screen_get_height (getScreen()); }
-
-int YGUI::getDisplayDepth()
-{ return gdk_visual_get_best_depth(); }
-
-long YGUI::getDisplayColors()
-{ return 1L << getDisplayDepth(); /*from yast-qt*/ }
-
-// YCP writers use getDefaultWidth/Height() to do space saving if needed,
-// so just tell me the displayWidth/Height(). If that size is decent, let's
-// us deal with it.
-int YGUI::getDefaultWidth() { return getDisplayWidth(); }
-int YGUI::getDefaultHeight() { return getDisplayHeight(); }
-
-int YGUI::_getDefaultWidth()
-{
- if (!m_default_size.width)
- m_default_size.width = MIN (600, getDisplayWidth());
- return m_default_size.width;
-}
-
-int YGUI::_getDefaultHeight()
-{
- if (!m_default_size.height)
- m_default_size.height = MIN (450, getDisplayHeight());
- return m_default_size.height;
-}
-
// YWidget layout units -> pixels conversion. Same as yast-qt's.
int YGUI::deviceUnits (YUIDimension dim, float size)
{
@@ -418,28 +404,6 @@
gtk_window_present (window);
}
-YCPString YGUI::glyph (const YCPSymbol &symbol)
-{
- string sym = symbol->symbol();
- if (sym == YUIGlyph_ArrowLeft)
- return YCPString ("\u2190");
- if (sym == YUIGlyph_ArrowRight)
- return YCPString ("\u2192");
- if (sym == YUIGlyph_ArrowUp)
- return YCPString ("\u2191");
- if (sym == YUIGlyph_ArrowDown)
- return YCPString ("\u2193");
- if (sym == YUIGlyph_CheckMark)
- return YCPString ("\u2714");
- if (sym == YUIGlyph_BulletArrowRight)
- return YCPString ("\u279c");
- if (sym == YUIGlyph_BulletCircle)
- return YCPString ("\u274d");
- if (sym == YUIGlyph_BulletSquare)
- return YCPString ("\u274f");
- return YCPString ("");
-}
-
void YGUI::toggleRecordMacro()
{
if (recordingMacro()) {
@@ -584,53 +548,44 @@
return askForFileOrDirectory (GTK_FILE_CHOOSER_ACTION_SAVE, path, filter, title);
}
-int
-YGApplication::displayWidth()
-{
- // return qApp->desktop()->width();
- return 1024;
-}
-
-
-int
-YGApplication::displayHeight()
-{
- //return qApp->desktop()->height();
- return 768;
-}
-
-
-int
-YGApplication::displayDepth()
+std::string YGApplication::glyph (const std::string &sym)
{
- //return qApp->desktop()->depth();
- return 16;
-}
-
-
-long
-YGApplication::displayColors()
-{
- return 1L << displayDepth();
-}
-
-int
-YGApplication::defaultWidth()
-{
- // return qApp->desktop()->width();
- return 800;
+ if (sym == YUIGlyph_ArrowLeft)
+ return "\u2190";
+ if (sym == YUIGlyph_ArrowRight)
+ return "\u2192";
+ if (sym == YUIGlyph_ArrowUp)
+ return "\u2191";
+ if (sym == YUIGlyph_ArrowDown)
+ return "\u2193";
+ if (sym == YUIGlyph_CheckMark)
+ return "\u2714";
+ if (sym == YUIGlyph_BulletArrowRight)
+ return "\u279c";
+ if (sym == YUIGlyph_BulletCircle)
+ return "\u274d";
+ if (sym == YUIGlyph_BulletSquare)
+ return "\u274f";
+ return "";
}
+int YGApplication::displayWidth()
+{ return getDisplayWidth(); }
-int
-YGApplication::defaultHeight()
-{
- //return qApp->desktop()->height();
- return 600;
-}
+int YGApplication::displayHeight()
+{ return getDisplayHeight(); }
+int YGApplication::displayDepth()
+{ return gdk_visual_get_best_depth(); }
+long YGApplication::displayColors()
+{ return 1L << displayDepth(); /*from yast-qt*/ }
+// YCP writers use getDefaultWidth/Height() to do space saving if needed,
+// so just tell me the displayWidth/Height(). If that size is decent, let's
+// us deal with it.
+int YGApplication::defaultWidth() { return getDisplayWidth(); }
+int YGApplication::defaultHeight() { return getDisplayHeight(); }
YWidgetFactory *YGUI::createWidgetFactory()
{ return new YGWidgetFactory; }
Modified: trunk/gtk/src/YGUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/gtk/src/YGUI.h?rev=44146&r1=44145&r2=44146&view=diff
==============================================================================
--- trunk/gtk/src/YGUI.h (original)
+++ trunk/gtk/src/YGUI.h Tue Feb 5 04:44:22 2008
@@ -62,24 +62,6 @@
virtual int deviceUnits (YUIDimension dim, float layout_units);
virtual float layoutUnits (YUIDimension dim, int device_units);
- virtual YCPString glyph (const YCPSymbol &glyphSymbol);
-
- virtual int getDisplayWidth();
- virtual int getDisplayHeight();
- virtual int getDisplayDepth();
- virtual long getDisplayColors();
- virtual int getDefaultWidth();
- virtual int getDefaultHeight();
- virtual bool textMode() IMPL_RET (false)
- virtual bool hasImageSupport() IMPL_RET (true)
- virtual bool hasLocalImageSupport() IMPL_RET (true)
- virtual bool hasAnimationSupport() IMPL_RET (true)
- virtual bool hasIconSupport() IMPL_RET (true)
- virtual bool hasFullUtf8Support() IMPL_RET (true)
- virtual bool richTextSupportsTable() IMPL_RET (false)
-
- virtual void showDialog (YDialog *dialog);
- virtual void closeDialog (YDialog *dialog);
virtual void busyCursor();
virtual void normalCursor();
@@ -233,6 +215,8 @@
public:
YGApplication();
+ virtual std::string glyph (const std::string &symbolName);
+
virtual std::string askForExistingDirectory (const std::string &startDir,
const std::string &headline);
virtual std::string askForExistingFile (const std::string &startWith,
@@ -240,28 +224,21 @@
virtual std::string askForSaveFileName (const std::string &startWith,
const std::string &filter, const std::string &headline);
-
- virtual int displayWidth();
- virtual int displayHeight();
- virtual int displayDepth();
- virtual long displayColors();
-
- // Size of main dialogs
- virtual int defaultWidth();
- virtual int defaultHeight();
-
- virtual bool leftHandedMouse() IMPL_RET (false)
- //
- // UI capabilities
- //
+ virtual int displayWidth();
+ virtual int displayHeight();
+ virtual int displayDepth();
+ virtual long displayColors();
+ virtual int defaultWidth(); // internally, use _defaultWidth / Height()
+ virtual int defaultHeight();
virtual bool isTextMode() IMPL_RET (false)
- virtual bool hasImageSupport() IMPL_RET (true)
- virtual bool hasLocalImageSupport() IMPL_RET (true)
- virtual bool hasAnimationSupport() IMPL_RET (true)
- virtual bool hasIconSupport() IMPL_RET (true)
- virtual bool hasFullUtf8Support() IMPL_RET (true)
- virtual bool richTextSupportsTable() IMPL_RET (false)
+ virtual bool leftHandedMouse() IMPL_RET (false)
+ virtual bool hasImageSupport() IMPL_RET (true)
+ virtual bool hasLocalImageSupport() IMPL_RET (true)
+ virtual bool hasAnimationSupport() IMPL_RET (true)
+ virtual bool hasIconSupport() IMPL_RET (true)
+ virtual bool hasFullUtf8Support() IMPL_RET (true)
+ virtual bool richTextSupportsTable() IMPL_RET (false)
};
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org