]> mj.ucw.cz Git - paperjam.git/blobdiff - jam.h
Added debugging dump of page operations
[paperjam.git] / jam.h
diff --git a/jam.h b/jam.h
index 5ee7620d050cd28163062943431bc127b3bda4ad..ae563337e7ca890a9af239951a694de64dd6404f 100644 (file)
--- a/jam.h
+++ b/jam.h
@@ -27,6 +27,13 @@ static inline bool is_equal(double x, double y)
   return is_zero(x-y);
 }
 
+void debug(const char *msg, ...) FORMAT_CHECK(printf, 1, 2);
+void warn(const char *msg, ...) FORMAT_CHECK(printf, 1, 2);
+void die(const char *msg, ...) FORMAT_CHECK(printf, 1, 2) NONRET;
+
+// This one is called during execution of commands and propagated as an exception
+void err(const char *msg, ...) FORMAT_CHECK(printf, 1, 2) NONRET;
+
 #include "pdf-tools.h"
 
 /*** Representation of commands ***/
@@ -79,6 +86,7 @@ struct page {
   double height;
   BBox image_box;      // Bounds useful contents
   virtual void render(out_context *out UNUSED, pdf_matrix xform UNUSED) { abort(); }
+  virtual void debug_dump() = 0;
   page(double _w=0, double _h=0) : index(0), width(_w), height(_h), image_box() { }
   page(page *p)
     {
@@ -91,6 +99,7 @@ struct page {
 
 struct empty_page : public page {
   void render(out_context *out UNUSED, pdf_matrix xform UNUSED) { }
+  void debug_dump() { debug("Empty page"); }
   empty_page(double _w=0, double _h=0) : page(_w, _h) { };
 };
 
@@ -144,13 +153,6 @@ extern bool recalc_bbox;
 extern int debug_level;
 extern int debug_indent;
 
-void debug(const char *msg, ...) FORMAT_CHECK(printf, 1, 2);
-void warn(const char *msg, ...) FORMAT_CHECK(printf, 1, 2);
-void die(const char *msg, ...) FORMAT_CHECK(printf, 1, 2) NONRET;
-
-// This one is called during execution of commands and propagated as an exception
-void err(const char *msg, ...) FORMAT_CHECK(printf, 1, 2) NONRET;
-
 class paperjam_error : public exception {
   string message;
 public: