1 #ifndef PRINT_H
2 #define PRINT_H
3 
4 #include <denemo/denemo.h>
5 
6 #define PRINTMARKER (22)
7 #define GREATER 2
8 #define SAME 1
9 #define LESSER 0
10 #define GPID_NONE (-1)
11 #define INSTALLED_LILYPOND_VERSION "2.18.0"       /* FIXME set via gub */
12 #define MANUAL _("Manual Updates")
13 #define CONTINUOUS _("Continuous")
14 #ifdef G_OS_WIN32
15 #define  return_on_windows_if_printing \
16   if (Denemo.printstatus->printpid != GPID_NONE)\
17     {\
18     warningdialog (_("Already doing a print"));\
19     return;\
20     }
21 #define  return1_on_windows_if_printing \
22   if (Denemo.printstatus->printpid != GPID_NONE)\
23     {\
24     warningdialog (_("Already doing a print"));\
25     return 1;\
26     }
27 #else
28 #define  return_on_windows_if_printing
29 #define  return1_on_windows_if_printing
30 #endif
31 
32 
33 typedef struct WwRectangle
34 {
35   gdouble x, y, width, height;
36 } WwRectangle;                    //Width=0 means no rectangle set
37 
38 typedef struct WwPoint
39 {
40   gint x, y;
41 } WwPoint;                    //Width=0 means no rectangle set
42 
43 typedef struct Curve
44 {
45   WwPoint p1, p2, p3, p4;
46 } Curve;
47 
48 typedef enum
49 {
50   STAGE_NONE,
51   Offsetting,
52   Selecting,
53   TargetEstablished,            //the get_wysiwyg_info()->grob has been set
54   SelectingNearEnd,
55   SelectingFarEnd,
56   DraggingNearEnd,
57   DraggingFarEnd,
58   WaitingForDrag,
59   SelectingReference,
60   WaitingForCurveDrag,
61   SelectingPoint,
62   Dragging1,
63   Dragging2,
64   Dragging3,
65   Dragging4,
66   TypesetForPlaybackView
67 } WwStage;
68 
69 typedef enum
70 {
71   TASK_NONE,
72   Positions,
73   Padding,
74   Offset,
75   Shape
76 } WwTask;
77 
78 typedef enum
79 {
80   OBJ_NONE,
81   Beam,
82   Slur,
83   Tie,
84   Articulation,
85   BassFigure,
86 } WwGrob;
87 
88 typedef struct WysiwygInfo
89 {
90   WwRectangle Mark;
91   WwRectangle Reference;          //reference is origin for LilyPond offsets, set by the user with blue cross wires.
92   Curve Curve;
93   gdouble curx, cury;           // position of mouse pointer during motion
94   //gdouble pointx, pointy; becomes near.x,y
95   gboolean ObjectLocated;       //TRUE when an external-link has just been followed back to a Denemo object
96   gint button;                  //which mouse button was last pressed
97   WwPoint nearpoint;                //left hand end of slur, beam etc
98   WwPoint farpoint;                 //right hand end of slur, beam etc
99   WwPoint near_i;              //initial left hand end of slur, beam etc
100   WwPoint far_i;               //initial right hand end of slur, beam etc
101   WwPoint last_button_press;
102   WwPoint last_button_release;
103   WwStage stage;
104   WwGrob grob;
105   WwTask task;
106   DenemoPosition pos;
107   gboolean repeatable;          //if pos is still the same, and the same edit parameters, just continue editing.
108   GtkWidget *dialog;            //an info dialog to tell the user what to do next...
109 } WysiwygInfo;
110 
111 extern gint LilyPond_stderr;       //A file descriptor to pipe for LilyPond's stderr
112 extern GError *lily_err;
113 extern GPid previewerpid;
114 
115 WysiwygInfo* get_wysiwyg_info();
116 void initialize_print_status (void);
117 void printall_cb (GtkAction * action, DenemoScriptParam * param);
118 void printmovement_cb (GtkAction * action, DenemoScriptParam * param);
119 void printpart_cb (GtkAction * action, DenemoScriptParam * param);
120 void printselection_cb (GtkAction * action, DenemoScriptParam * param);
121 
122 void printexcerptpreview_cb (GtkAction * action, DenemoScriptParam * param);
123 gchar *get_lily_version_string (void);
124 void export_pdf (gchar * filename, DenemoProject * gui);
125 void export_png (gchar * filename, GChildWatchFunc finish, DenemoProject * gui);
126 void printpng_finished (GPid pid, gint status, GList * filelist);
127 gboolean create_thumbnail (gboolean async, gchar* thumbnail_path);
128 gchar *large_thumbnail_name (gchar * filepath);
129 gboolean stop_lilypond ();
130 void process_lilypond_errors (gchar * filename);
131 gchar *get_printfile_pathbasename (void);
132 void create_pdf (gboolean part_only, gboolean all_movements);
133 void show_print_view (GtkAction * action, DenemoScriptParam * param);
134 void create_svg (gboolean part_only, gboolean all_movements);
135 #endif /*PRINT_H */
136