1 /* 2 3 This file is from Nitrogen, an X11 background setter. 4 Copyright (C) 2006 Dave Foster & Javeed Shaikh 5 6 This program is free software; you can redistribute it and/or 7 modify it under the terms of the GNU General Public License 8 as published by the Free Software Foundation; either version 2 9 of the License, or (at your option) any later version. 10 11 This program is distributed in the hope that it will be useful, 12 but WITHOUT ANY WARRANTY; without even the implied warranty of 13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14 GNU General Public License for more details. 15 16 You should have received a copy of the GNU General Public License 17 along with this program; if not, write to the Free Software 18 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. 19 20 */ 21 22 #ifndef _NWINDOW_H_ 23 #define _NWINDOW_H_ 24 25 #include "main.h" 26 #include "Thumbview.h" 27 #include "ImageCombo.h" 28 #include "SetBG.h" 29 30 class NWindow : public Gtk::Window { 31 public: 32 NWindow(SetBG* bg_setter); 33 void show (void); 34 virtual ~NWindow (); 35 36 Thumbview view; 37 void sighandle_dblclick_item(const Gtk::TreeModel::Path& path); 38 void sighandle_click_apply(void); 39 void sighandle_mode_change(void); 40 41 void set_default_selections(); 42 43 std::map<Glib::ustring, Glib::ustring> map_displays; // a map of current displays on the running instance to their display names 44 void set_default_display(int display); 45 46 bool set_bg(Glib::ustring file); 47 48 protected: 49 Glib::RefPtr<Gtk::ActionGroup> m_action_group; 50 Glib::RefPtr<Gtk::UIManager> m_ui_manager; 51 Gtk::VBox main_vbox; 52 Gtk::HBox bot_hbox; 53 SetBG* bg_setter; 54 55 ImageCombo select_mode, select_display; 56 57 Gtk::Button apply; 58 Gtk::Button btn_prefs; 59 Gtk::ColorButton button_bgcolor; 60 61 bool m_dirty; // set if the user double clicks to preview but forgets to press apply 62 63 void setup_select_boxes(); 64 65 void sighandle_accel_quit(); 66 void sighandle_random(); 67 void sighandle_togb_list_toggled(); 68 void sighandle_togb_icon_toggled(); 69 void sighandle_btn_prefs(); 70 void apply_bg(); 71 72 virtual bool on_delete_event(GdkEventAny *event); 73 bool handle_exit_request(); 74 75 #ifdef USE_XINERAMA 76 // xinerama stuff 77 XineramaScreenInfo* xinerama_info; 78 gint xinerama_num_screens; 79 #endif 80 }; 81 82 #endif 83