2016-08-08 23:11:27 +03:00
|
|
|
/************************************************************************
|
|
|
|
* file name : globals.cpp
|
|
|
|
* ----------------- :
|
|
|
|
* creation time : 2016/08/03
|
|
|
|
* author : Victor Zarubkin
|
|
|
|
* email : v.s.zarubkin@gmail.com
|
|
|
|
* ----------------- :
|
|
|
|
* description : The file contains implementation of global constants and variables for profiler gui.
|
|
|
|
* ----------------- :
|
|
|
|
* change log : * 2016/08/03 Victor Zarubkin: initial commit.
|
|
|
|
* :
|
|
|
|
* : *
|
|
|
|
* ----------------- :
|
2016-09-06 21:49:32 +03:00
|
|
|
* license : Lightweight profiler library for c++
|
2018-01-29 23:29:43 +03:00
|
|
|
* : Copyright(C) 2016-2018 Sergey Yagovtsev, Victor Zarubkin
|
2016-09-06 21:49:32 +03:00
|
|
|
* :
|
2017-03-30 06:55:15 +03:00
|
|
|
* : Licensed under either of
|
|
|
|
* : * MIT license (LICENSE.MIT or http://opensource.org/licenses/MIT)
|
|
|
|
* : * Apache License, Version 2.0, (LICENSE.APACHE or http://www.apache.org/licenses/LICENSE-2.0)
|
|
|
|
* : at your option.
|
2016-11-13 16:39:59 +03:00
|
|
|
* :
|
2017-03-30 06:55:15 +03:00
|
|
|
* : The MIT License
|
|
|
|
* :
|
|
|
|
* : Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* : of this software and associated documentation files (the "Software"), to deal
|
|
|
|
* : in the Software without restriction, including without limitation the rights
|
|
|
|
* : to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
|
|
* : of the Software, and to permit persons to whom the Software is furnished
|
|
|
|
* : to do so, subject to the following conditions:
|
|
|
|
* :
|
|
|
|
* : The above copyright notice and this permission notice shall be included in all
|
|
|
|
* : copies or substantial portions of the Software.
|
|
|
|
* :
|
|
|
|
* : THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
|
|
|
|
* : INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
|
|
|
|
* : PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
|
|
|
* : LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
|
|
|
|
* : TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
|
|
|
|
* : USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
* :
|
|
|
|
* : The Apache License, Version 2.0 (the "License")
|
|
|
|
* :
|
|
|
|
* : You may not use this file except in compliance with the License.
|
2016-11-13 16:39:59 +03:00
|
|
|
* : You may obtain a copy of the License at
|
|
|
|
* :
|
|
|
|
* : http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
* :
|
|
|
|
* : Unless required by applicable law or agreed to in writing, software
|
|
|
|
* : distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* : WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* : See the License for the specific language governing permissions and
|
|
|
|
* : limitations under the License.
|
2016-08-03 23:00:04 +03:00
|
|
|
************************************************************************/
|
|
|
|
|
2016-08-08 22:45:57 +03:00
|
|
|
#define IGNORE_GLOBALS_DECLARATION
|
2016-08-03 23:00:04 +03:00
|
|
|
#include "globals.h"
|
2016-08-08 22:45:57 +03:00
|
|
|
#undef IGNORE_GLOBALS_DECLARATION
|
2016-08-03 23:00:04 +03:00
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
namespace profiler_gui {
|
|
|
|
|
2018-01-28 20:52:17 +03:00
|
|
|
Globals& Globals::instance()
|
2016-08-03 23:00:04 +03:00
|
|
|
{
|
2017-06-07 02:08:53 +03:00
|
|
|
// It's okay even without C++11 "magic statics" feature because first call happens
|
|
|
|
// on application initialization - there is only one thread and no data races occur.
|
2018-01-28 20:52:17 +03:00
|
|
|
static Globals globals;
|
2016-08-03 23:00:04 +03:00
|
|
|
return globals;
|
|
|
|
}
|
|
|
|
|
2018-01-28 20:52:17 +03:00
|
|
|
Globals::Globals()
|
2017-11-26 15:37:39 +03:00
|
|
|
: theme("default")
|
|
|
|
, bg_font(::profiler_gui::EFont("DejaVu Sans", 10, QFont::Bold))
|
|
|
|
, chronometer_font(::profiler_gui::EFont("DejaVu Sans", 16, QFont::Bold))
|
|
|
|
, items_font(::profiler_gui::EFont("DejaVu Sans", 10, QFont::Medium))
|
|
|
|
, selected_item_font(::profiler_gui::EFont("DejaVu Sans", 10, QFont::Medium))
|
|
|
|
, begin_time(0)
|
2017-06-06 20:46:06 +03:00
|
|
|
, selected_thread(0U)
|
2016-08-24 01:00:24 +03:00
|
|
|
, selected_block(::profiler_gui::numeric_max<decltype(selected_block)>())
|
2016-11-30 21:59:40 +03:00
|
|
|
, selected_block_id(::profiler_gui::numeric_max<decltype(selected_block_id)>())
|
2017-06-06 20:46:06 +03:00
|
|
|
, version(0)
|
2017-04-17 22:09:53 +03:00
|
|
|
, frame_time(16700)
|
|
|
|
, blocks_spacing(0)
|
2017-02-08 21:47:11 +03:00
|
|
|
, blocks_size_min(2)
|
2016-11-19 04:52:45 +03:00
|
|
|
, blocks_narrow_size(20)
|
2017-04-17 22:09:53 +03:00
|
|
|
, max_fps_history(90)
|
|
|
|
, fps_timer_interval(500)
|
2017-04-05 22:37:40 +03:00
|
|
|
, fps_widget_line_width(2)
|
2017-04-17 22:09:53 +03:00
|
|
|
, chrono_text_position(ChronoTextPosition_Top)
|
2017-03-07 00:29:34 +03:00
|
|
|
, time_units(TimeUnits_ms)
|
2016-09-25 11:49:49 +03:00
|
|
|
, connected(false)
|
2017-04-03 23:16:36 +03:00
|
|
|
, fps_enabled(true)
|
2017-04-17 22:09:53 +03:00
|
|
|
, use_decorated_thread_name(false)
|
2017-06-05 21:26:10 +03:00
|
|
|
, hex_thread_id(false)
|
2017-03-13 20:30:57 +03:00
|
|
|
, enable_event_markers(true)
|
2016-09-14 23:13:38 +03:00
|
|
|
, enable_statistics(true)
|
2016-11-23 22:54:59 +03:00
|
|
|
, enable_zero_length(true)
|
2016-11-26 18:08:02 +03:00
|
|
|
, add_zero_blocks_to_hierarchy(false)
|
2016-08-04 23:35:38 +03:00
|
|
|
, draw_graphics_items_borders(true)
|
2016-11-20 14:39:01 +03:00
|
|
|
, hide_narrow_children(false)
|
2016-12-12 21:39:16 +03:00
|
|
|
, hide_minsize_blocks(false)
|
2016-08-09 00:14:58 +03:00
|
|
|
, display_only_relevant_stats(true)
|
2016-08-23 22:44:04 +03:00
|
|
|
, collapse_items_on_tree_close(false)
|
|
|
|
, all_items_expanded_by_default(true)
|
2016-11-20 21:01:33 +03:00
|
|
|
, only_current_thread_hierarchy(false)
|
2016-11-30 21:59:40 +03:00
|
|
|
, highlight_blocks_with_same_id(true)
|
2016-12-04 16:51:27 +03:00
|
|
|
, selecting_block_changes_thread(true)
|
2017-04-17 22:09:53 +03:00
|
|
|
, auto_adjust_histogram_height(true)
|
2018-01-25 23:21:56 +03:00
|
|
|
, auto_adjust_chart_height(false)
|
2017-06-07 02:08:53 +03:00
|
|
|
, display_only_frames_on_histogram(false)
|
2016-08-23 23:50:30 +03:00
|
|
|
, bind_scene_and_tree_expand_status(true)
|
2016-08-03 23:00:04 +03:00
|
|
|
{
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} // END of namespace profiler_gui.
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////
|
|
|
|
|