Commit 39ea41b9 authored by Christian Persch's avatar Christian Persch

draw: Move remaining class into new file

parent 4c58cac2
/*
* Copyright (C) 2003,2008 Red Hat, Inc.
* Copyright © 2019 Christian Persch
* Copyright © 2019, 2020 Christian Persch
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
* version 3 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#include "config.h"
#include <algorithm>
#include <math.h>
#include <cmath>
#include <stdlib.h>
#include <string.h>
#include <glib.h>
#include <gtk/gtk.h>
#include "attr.hh"
#include "bidi.hh"
#include "vtedraw.hh"
#include "vtedefines.hh"
#include "debug.h"
#include <pango/pangocairo.h>
#include "drawing-cairo.hh"
#include "fonts-pangocairo.hh"
#include "refptr.hh"
#define VTE_DRAW_NORMAL 0
#define VTE_DRAW_BOLD 1
......@@ -63,13 +49,13 @@ guint _vte_draw_get_style(gboolean bold, gboolean italic) {
static inline constexpr double
_vte_draw_get_undercurl_rad(gint width)
{
return width / 2. / sqrt(2);
return width / 2. / M_SQRT2;
}
static inline constexpr double
_vte_draw_get_undercurl_arc_height(gint width)
{
return _vte_draw_get_undercurl_rad(width) * (1. - sqrt(2) / 2.);
return _vte_draw_get_undercurl_rad(width) * (1. - M_SQRT2 / 2.);
}
double
......
......@@ -12,29 +12,29 @@
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include <array>
#include <cstdint>
#include <memory>
#include <cairo.h>
#include <glib.h>
#include <gtk/gtk.h>
#include <cairo.h>
#include "vteunistr.h"
#include "vtetypes.hh"
#include "fwd.hh"
#include "minifont.hh"
#include "vtetypes.hh"
#include "vteunistr.h"
namespace vte {
namespace view {
class FontInfo;
class DrawingContext {
public:
......
......@@ -104,6 +104,8 @@ libvte_common_sources = debug_sources + glib_glue_sources + libc_glue_sources +
'chunk.hh',
'color-triple.hh',
'cxx-utils.hh',
'drawing-cairo.cc',
'drawing-cairo.hh',
'fonts-pangocairo.cc',
'fonts-pangocairo.hh',
'gobject-glue.hh',
......@@ -126,8 +128,6 @@ libvte_common_sources = debug_sources + glib_glue_sources + libc_glue_sources +
'utf8.hh',
'vte.cc',
'vtedefines.hh',
'vtedraw.cc',
'vtedraw.hh',
'vtegtk.cc',
'vtegtk.hh',
'vteinternal.hh',
......
......@@ -22,8 +22,8 @@
#include <cairo.h>
#include "drawing-cairo.hh"
#include "minifont.hh"
#include "vtedraw.hh"
/* pixman data must have stride 0 mod 4 */
static unsigned char const hatching_pattern_lr_data[16] = {
......
......@@ -39,7 +39,6 @@
#include "bidi.hh"
#include "buffer.h"
#include "debug.h"
#include "vtedraw.hh"
#include "reaper.hh"
#include "ring.hh"
#include "ringview.hh"
......
......@@ -33,9 +33,9 @@
#include <glib.h>
#include "glib-glue.hh"
#include "drawing-cairo.hh"
#include "vtedefines.hh"
#include "vtetypes.hh"
#include "vtedraw.hh"
#include "reaper.hh"
#include "ring.hh"
#include "ringview.hh"
......@@ -853,7 +853,7 @@ public:
/* First, the dimensions of ASCII characters are measured. The result
* could probably be called char_{width,height} or font_{width,height}
* but these aren't stored directly here, not to accidentally be confused
* with m_cell_{width_height}. The values are stored in vtedraw's font_info.
* with m_cell_{width_height}. The values are stored in FontInfo.
*
* Then in case of nondefault m_cell_{width,height}_scale an additional
* m_char_padding is added, resulting in m_cell_{width,height} which are
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment