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 _UTIL_H_
23 #define _UTIL_H_
24 
25 #include "ArgParser.h"
26 #include "SetBG.h"
27 #include <gtkmm.h>
28 
29 namespace Util {
30 
31 	void program_log(const char *format, ...);
32 	Glib::ustring path_to_abs_path(Glib::ustring path);
33 	ArgParser* create_arg_parser();
34 	std::string fix_start_dir(std::string startdir);
35     std::string pick_random_file(std::string path, bool recurse = false);
36     std::string pick_random_file(VecStrs paths, bool recurse = false);
37 
38     std::pair<VecStrs, VecStrs> get_image_files(std::string path, bool recurse = false);
39     bool is_image(std::string file);
40 
41     bool is_display_relevant(Gtk::Window* window, Glib::ustring display);
42     Glib::ustring make_current_set_string(Gtk::Window* window, Glib::ustring filename, Glib::ustring display);
43 
44     Glib::ustring color_to_string(Gdk::Color color);
45 }
46 
47 #endif
48 
49