Imported Upstream version 1.8.1
[platform/upstream/harfbuzz.git] / util / view-cairo.hh
index cb52373..00df68c 100644 (file)
  * Google Author(s): Behdad Esfahbod
  */
 
-#include "options.hh"
-#include "helper-cairo.hh"
-
 #ifndef VIEW_CAIRO_HH
 #define VIEW_CAIRO_HH
 
+#include "hb-private.hh"
+#include "options.hh"
+#include "helper-cairo.hh"
+
 
 struct view_cairo_t
 {
@@ -39,11 +40,10 @@ struct view_cairo_t
                 direction (HB_DIRECTION_INVALID),
                 lines (0), scale_bits (0) {}
   ~view_cairo_t (void) {
-    if (debug)
-      cairo_debug_reset_static_data ();
+    cairo_debug_reset_static_data ();
   }
 
-  void init (const font_options_t *font_opts)
+  void init (hb_buffer_t *buffer, const font_options_t *font_opts)
   {
     lines = g_array_new (false, false, sizeof (helper_cairo_line_t));
     scale_bits = -font_opts->subpixel_bits;
@@ -57,12 +57,9 @@ struct view_cairo_t
                     hb_bool_t     utf8_clusters)
   {
   }
-  void shape_failed (hb_buffer_t  *buffer,
-                    const char   *text,
-                    unsigned int  text_len,
-                    hb_bool_t     utf8_clusters)
+  void error (const char *message)
   {
-    fail (false, "all shapers failed");
+    g_printerr ("%s: %s\n", g_get_prgname (), message);
   }
   void consume_glyphs (hb_buffer_t  *buffer,
                       const char   *text,
@@ -74,7 +71,7 @@ struct view_cairo_t
     helper_cairo_line_from_buffer (&l, buffer, text, text_len, scale_bits, utf8_clusters);
     g_array_append_val (lines, l);
   }
-  void finish (const font_options_t *font_opts)
+  void finish (hb_buffer_t *buffer, const font_options_t *font_opts)
   {
     render (font_opts);
 
@@ -95,8 +92,6 @@ struct view_cairo_t
   view_options_t view_options;
 
   void render (const font_options_t *font_opts);
-  void get_surface_size (cairo_scaled_font_t *scaled_font, double *w, double *h);
-  void draw (cairo_t *cr);
 
   hb_direction_t direction; // Remove this, make segment_properties accessible
   GArray *lines;