[gtkmm/gtkmm-3-8: 2/2] Revert "Fix the build with --enable-warnings=fatal"
- From: Murray Cumming <murrayc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtkmm/gtkmm-3-8: 2/2] Revert "Fix the build with --enable-warnings=fatal"
- Date: Fri, 17 May 2013 11:04:23 +0000 (UTC)
commit d5714d5522f0e2dc162c64e21dfed7a4a46b05f7
Author: Murray Cumming <murrayc murrayc com>
Date: Fri May 17 13:04:04 2013 +0200
Revert "Fix the build with --enable-warnings=fatal"
This reverts commit 284d17e9d58e70d0e0c01a25d3f3c1634f3f362d.
Conflicts:
ChangeLog
ChangeLog | 10 +++
demos/gtk-demo/example_change_display.cc | 112 ++++++++++++++++++++++++-----
gdk/src/display.hg | 10 +--
3 files changed, 105 insertions(+), 27 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index ed30ffa..cc79801 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,14 @@
+<<<<<<< HEAD
3.8.1:
+=======
+2013-05-07 Murray Cumming <murrayc murray com>
+
+ Fix the build with --enable-warnings=fatal, partly.
+
+ * tools/extra_defs_gen/generate_defs_gtk.cc: Add a define of
+ GDK_DISABLE_DEPRECATION_WARNINGS, though I do not know why this is only
+ necessary now, using GTK+ from git master.
+>>>>>>> parent of 284d17e... Fix the build with --enable-warnings=fatal
2013-04-29 Kjell Ahlstedt <kjell ahlstedt bredband net>
diff --git a/demos/gtk-demo/example_change_display.cc b/demos/gtk-demo/example_change_display.cc
index c93770c..c33202f 100644
--- a/demos/gtk-demo/example_change_display.cc
+++ b/demos/gtk-demo/example_change_display.cc
@@ -1,23 +1,24 @@
/* Change Display
*
- * Demonstrates migrating a window between different displays.
- * A display is a mouse and keyboard with some number of
- * associated monitors. The neat thing about having multiple
- * displays is that they can be on a completely separate
+ * Demonstrates migrating a window between different displays and
+ * screens. A display is a mouse and keyboard with some number of
+ * associated monitors. A screen is a set of monitors grouped
+ * into a single physical work area. The neat thing about having
+ * multiple displays is that they can be on a completely separate
* computers, as long as there is a network connection to the
* computer where the application is running.
*
* Only some of the windowing systems where GTK+ runs have the
- * concept of multiple displays. (The X Window System is the
- * main example.) Other windowing systems can only handle one
- * keyboard and mouse, and combine all monitors into
- * a single display.
+ * concept of multiple displays and screens. (The X Window System
+ * is the main example.) Other windowing systems can only
+ * handle one keyboard and mouse, and combine all monitors into
+ * a single screen.
*
* This is a moderately complex example, and demonstrates:
*
- * - Tracking the currently open displays
+ * - Tracking the currently open displays and screens
*
- * - Changing the display for a window
+ * - Changing the screen for a window
*
* - Letting the user choose a window by clicking on it
*
@@ -32,7 +33,7 @@
class Popup : public Gtk::Window
{
public:
- Popup(const Glib::RefPtr<Gdk::Screen>& screen, const Glib::ustring& prompt);
+ Popup(const Glib::RefPtr<Gdk::Screen> screen, const Glib::ustring& prompt);
virtual ~Popup();
protected:
@@ -50,6 +51,7 @@ protected:
virtual void setup_frame(Gtk::Frame& frame, Gtk::TreeView& treeview, Gtk::Box& buttonbox);
virtual void initialize_displays();
+ virtual void fill_screens();
virtual void query_change_display();
virtual Gtk::Widget* find_toplevel_at_pointer(const Glib::RefPtr<Gdk::Display>& display);
virtual Gtk::Window* query_for_toplevel(const Glib::RefPtr<Gdk::Screen>& screen, const Glib::ustring&
prompt);
@@ -59,6 +61,7 @@ protected:
virtual void on_button_display_close();
virtual void on_treeview_display_selection_changed();
+ virtual void on_treeview_screen_selection_changed();
virtual void on_display_closed(bool is_error, Glib::RefPtr<Gdk::Display> display);
@@ -77,18 +80,29 @@ protected:
};
ModelColumns_Display m_columns_display;
+ class ModelColumns_Screen : public Gtk::TreeModelColumnRecord
+ {
+ public:
+ Gtk::TreeModelColumn<int> m_number;
+ Gtk::TreeModelColumn< Glib::RefPtr<Gdk::Screen> > m_screen; //hidden
+
+ ModelColumns_Screen() { add(m_number); add(m_screen); }
+ };
+ ModelColumns_Screen m_columns_screen;
+
Gtk::Box m_VBox;
- Gtk::Frame m_Frame_Display;
- Gtk::TreeView m_TreeView_Display;
- Glib::RefPtr<Gtk::ListStore> m_refListStore_Display;
- Gtk::Box m_ButtonBox_Display;
+ Gtk::Frame m_Frame_Display, m_Frame_Screen;
+ Gtk::TreeView m_TreeView_Display, m_TreeView_Screen;
+ Glib::RefPtr<Gtk::ListStore> m_refListStore_Display, m_refListStore_Screen;
+ Gtk::Box m_ButtonBox_Display, m_ButtonBox_Screen;
Gtk::Button m_Button_Display_Open, m_Button_Display_Close;
- Glib::RefPtr<Gtk::SizeGroup> m_refSizeGroup_Display;
+ Glib::RefPtr<Gtk::SizeGroup> m_refSizeGroup_Display, m_refSizeGroup_Screen;
Glib::RefPtr<Gdk::Display> m_refCurrentDisplay;
+ Glib::RefPtr<Gdk::Screen> m_refCurrentScreen;
Popup* m_pPopup;
@@ -99,10 +113,11 @@ protected:
Example_ChangeDisplay::Example_ChangeDisplay()
-: Gtk::Dialog("Change Display"),
+: Gtk::Dialog("Change Screen or display"),
m_VBox(Gtk::ORIENTATION_VERTICAL, 5),
m_Frame_Display("Display"),
- m_ButtonBox_Display(Gtk::ORIENTATION_VERTICAL, 5),
+ m_Frame_Screen("Screen"),
+ m_ButtonBox_Display(Gtk::ORIENTATION_VERTICAL, 5), m_ButtonBox_Screen(Gtk::ORIENTATION_VERTICAL, 5),
m_Button_Display_Open("_Open...", true), m_Button_Display_Close("_Close...", true),
m_pPopup(0),
m_popup_clicked(false)
@@ -139,6 +154,25 @@ Example_ChangeDisplay::Example_ChangeDisplay()
m_refSizeGroup_Display->add_widget(m_ButtonBox_Display);
}
+ //Screen:
+ {
+ setup_frame(m_Frame_Screen, m_TreeView_Screen, m_ButtonBox_Screen);
+
+ //Setup TreeView:
+ m_refListStore_Screen = Gtk::ListStore::create(m_columns_screen);
+ m_TreeView_Screen.set_model(m_refListStore_Screen);
+ m_TreeView_Screen.append_column("Number", m_columns_screen.m_number);
+
+ //Connect signal:
+ Glib::RefPtr<Gtk::TreeView::Selection> refSelection = m_TreeView_Screen.get_selection();
+ refSelection->signal_changed().connect( sigc::mem_fun(*this,
&Example_ChangeDisplay::on_treeview_screen_selection_changed) );
+
+ m_VBox.pack_start(m_Frame_Screen);
+
+ m_refSizeGroup_Screen = Gtk::SizeGroup::create(Gtk::SIZE_GROUP_HORIZONTAL);
+ m_refSizeGroup_Screen->add_widget(m_ButtonBox_Screen);
+ }
+
initialize_displays();
show_all();
@@ -264,8 +298,46 @@ void Example_ChangeDisplay::on_treeview_display_selection_changed()
m_refCurrentDisplay = (*iter)[m_columns_display.m_display];
else
m_refCurrentDisplay.reset();
+
+ fill_screens();
+}
+
+void Example_ChangeDisplay::on_treeview_screen_selection_changed()
+{
+ Glib::RefPtr<Gtk::TreeSelection> refSelection = m_TreeView_Screen.get_selection();
+ Gtk::TreeModel::iterator iter = refSelection->get_selected();
+ if(iter)
+ m_refCurrentScreen = (*iter)[m_columns_screen.m_screen];
+ else
+ m_refCurrentScreen.reset();
}
+/* Fills in the screen list based on the current display
+ */
+void Example_ChangeDisplay::fill_screens()
+{
+ m_refListStore_Screen->clear();
+
+ if(m_refCurrentScreen)
+ {
+ int n_screens = m_refCurrentDisplay->get_n_screens();
+
+ for (int i = 0; i < n_screens; i++)
+ {
+ Glib::RefPtr<Gdk::Screen> refScreen = m_refCurrentDisplay->get_screen(i);
+
+ Gtk::TreeModel::Row row = *(m_refListStore_Screen->append());
+ row[m_columns_screen.m_number] = i;
+ row[m_columns_screen.m_screen] = refScreen;
+
+ if (i == 0)
+ {
+ Glib::RefPtr<Gtk::TreeSelection> refSelection = m_TreeView_Screen.get_selection();
+ refSelection->select(row);
+ }
+ }
+ }
+}
/* Prompts the user for a toplevel window to move, and then moves
* that window to the currently selected display
@@ -278,7 +350,7 @@ void Example_ChangeDisplay::query_change_display()
"to move to the new screen");
if (pTopLevel)
- pTopLevel->set_screen( m_refCurrentDisplay->get_screen() );
+ pTopLevel->set_screen(m_refCurrentScreen);
else
refScreen->get_display()->beep();
}
@@ -375,7 +447,7 @@ bool Example_ChangeDisplay::on_popup_button_release_event(GdkEventButton* /* eve
return true;
}
-Popup::Popup(const Glib::RefPtr<Gdk::Screen>& screen, const Glib::ustring& prompt)
+Popup::Popup(const Glib::RefPtr<Gdk::Screen> screen, const Glib::ustring& prompt)
: Gtk::Window(Gtk::WINDOW_POPUP),
m_Label(prompt)
{
diff --git a/gdk/src/display.hg b/gdk/src/display.hg
index ab51114..92c0927 100644
--- a/gdk/src/display.hg
+++ b/gdk/src/display.hg
@@ -24,10 +24,6 @@
_DEFS(gdkmm,gdk)
_PINCLUDE(glibmm/private/object_p.h)
-#m4 _PUSH(SECTION_CC_PRE_INCLUDES)
-#undef GDK_DISABLE_DEPRECATED
-#define GDK_DISABLE_DEPRECATION_WARNINGS 1
-#m4 _POP()
namespace Gdk
{
@@ -56,9 +52,9 @@ public:
_WRAP_METHOD(Glib::ustring get_name() const, gdk_display_get_name)
- _WRAP_METHOD(int get_n_screens() const, gdk_display_get_n_screens, deprecated "The number of screens is
always 1.")
- _WRAP_METHOD(Glib::RefPtr<Screen> get_screen(int screen_num = 0), gdk_display_get_screen, refreturn)
- _WRAP_METHOD(Glib::RefPtr<const Screen> get_screen(int screen_num = 0) const, gdk_display_get_screen,
refreturn, constversion)
+ _WRAP_METHOD(int get_n_screens() const, gdk_display_get_n_screens)
+ _WRAP_METHOD(Glib::RefPtr<Screen> get_screen(int screen_num), gdk_display_get_screen, refreturn)
+ _WRAP_METHOD(Glib::RefPtr<const Screen> get_screen(int screen_num) const, gdk_display_get_screen,
refreturn, constversion)
_WRAP_METHOD(Glib::RefPtr<Screen> get_default_screen(), gdk_display_get_default_screen, refreturn)
_WRAP_METHOD(Glib::RefPtr<const Screen> get_default_screen() const, gdk_display_get_default_screen,
refreturn, constversion)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]