Skip to content

Commit

Permalink
Merge pull request tectonic-typesetting#27 from burrbull/reference
Browse files Browse the repository at this point in the history
pdf_coord & pdf_color
  • Loading branch information
crlf0710 authored Sep 11, 2019
2 parents 52f7869 + 06efb67 commit c2a12ed
Show file tree
Hide file tree
Showing 22 changed files with 568 additions and 915 deletions.
2 changes: 1 addition & 1 deletion engine/src/dpx_cid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
unused_mut)]

extern crate libc;
use crate::dpx_pdfobj::{pdf_obj, pdf_file};
use crate::dpx_pdfobj::{pdf_file, pdf_obj};
use libc::free;
extern "C" {
#[no_mangle]
Expand Down
20 changes: 6 additions & 14 deletions engine/src/dpx_dvi.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
unused_mut)]

extern crate libc;
use super::dpx_pdfcolor::{pdf_color_pop, pdf_color_push, pdf_color_rgbcolor};
use crate::dpx_pdfobj::pdf_obj;
use libc::free;
extern "C" {
Expand Down Expand Up @@ -108,12 +109,6 @@ extern "C" {
fn pdf_number_value(number: *mut pdf_obj) -> f64;
#[no_mangle]
fn pdf_string_value(object: *mut pdf_obj) -> *mut libc::c_void;
#[no_mangle]
fn pdf_color_rgbcolor(color: *mut pdf_color, r: f64, g: f64, b: f64) -> i32;
#[no_mangle]
fn pdf_color_push(sc: *mut pdf_color, fc: *mut pdf_color);
#[no_mangle]
fn pdf_color_pop();
/* Draw texts and rules:
*
* xpos, ypos, width, and height are all fixed-point numbers
Expand Down Expand Up @@ -539,13 +534,9 @@ pub type fixword = i32;
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#[derive(Copy, Clone)]
#[repr(C)]
pub struct pdf_color {
pub num_components: i32,
pub spot_color_name: *mut i8,
pub values: [f64; 4],
}

pub use super::dpx_pdfcolor::pdf_color;

/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata,
Expand Down Expand Up @@ -3013,7 +3004,8 @@ unsafe extern "C" fn do_glyphs(mut do_actual_text: i32) {
(((*font).rgba_color >> 16i32) as u8 as i32 & 0xffi32) as f64 / 255i32 as f64,
(((*font).rgba_color >> 8i32) as u8 as i32 & 0xffi32) as f64 / 255i32 as f64,
);
pdf_color_push(&mut color, &mut color);
let color_clone = color.clone();
pdf_color_push(&mut color, &color_clone);
}
i = 0_u32;
while i < slen {
Expand Down
2 changes: 1 addition & 1 deletion engine/src/dpx_epdf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
unused_mut)]

extern crate libc;
use crate::dpx_pdfobj::{pdf_obj, pdf_file};
use super::dpx_pdfdraw::{pdf_dev_currentmatrix, pdf_dev_transform, pdf_invertmatrix};
use crate::dpx_pdfobj::{pdf_file, pdf_obj};
use libc::free;
extern "C" {
pub type _IO_wide_data;
Expand Down
26 changes: 7 additions & 19 deletions engine/src/dpx_mpost.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@
unused_mut)]

extern crate libc;
use crate::dpx_pdfobj::{pdf_obj, pdf_file};
use super::dpx_pdfcolor::{pdf_color_cmykcolor, pdf_color_graycolor, pdf_color_rgbcolor};
use super::dpx_pdfdraw::{
pdf_dev_concat, pdf_dev_currentmatrix, pdf_dev_dtransform, pdf_dev_idtransform,
pdf_dev_concat, pdf_dev_currentmatrix, pdf_dev_currentpoint, pdf_dev_dtransform,
pdf_dev_idtransform, pdf_dev_set_color,
};
use crate::dpx_pdfobj::{pdf_file, pdf_obj};
use libc::free;
extern "C" {
pub type _IO_wide_data;
Expand Down Expand Up @@ -102,12 +104,6 @@ extern "C" {
#[no_mangle]
fn pdf_add_dict(dict: *mut pdf_obj, key: *mut pdf_obj, value: *mut pdf_obj) -> i32;
#[no_mangle]
fn pdf_color_rgbcolor(color: *mut pdf_color, r: f64, g: f64, b: f64) -> i32;
#[no_mangle]
fn pdf_color_cmykcolor(color: *mut pdf_color, c: f64, m: f64, y: f64, k: f64) -> i32;
#[no_mangle]
fn pdf_color_graycolor(color: *mut pdf_color, g: f64) -> i32;
#[no_mangle]
fn transform_info_clear(info: *mut transform_info);
/* returns 1.0/unit_conv */
#[no_mangle]
Expand Down Expand Up @@ -233,8 +229,6 @@ extern "C" {
#[no_mangle]
fn pdf_doc_end_grabbing(attrib: *mut pdf_obj);
#[no_mangle]
fn pdf_dev_currentpoint(cp: *mut pdf_coord) -> i32;
#[no_mangle]
fn pdf_dev_setlinewidth(width: f64) -> i32;
#[no_mangle]
fn pdf_dev_setmiterlimit(mlimit: f64) -> i32;
Expand Down Expand Up @@ -276,8 +270,6 @@ extern "C" {
fn pdf_dev_gsave() -> i32;
#[no_mangle]
fn pdf_dev_grestore() -> i32;
#[no_mangle]
fn pdf_dev_set_color(color: *const pdf_color, mask: i8, force: i32);
/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata,
Expand Down Expand Up @@ -404,13 +396,9 @@ pub type fixword = i32;
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
*/
#[derive(Copy, Clone)]
#[repr(C)]
pub struct pdf_color {
pub num_components: i32,
pub spot_color_name: *mut i8,
pub values: [f64; 4],
}

pub use super::dpx_pdfcolor::pdf_color;

/* This is dvipdfmx, an eXtended version of dvipdfm by Mark A. Wicks.
Copyright (C) 2002-2016 by Jin-Hwan Cho and Shunsaku Hirata,
Expand Down
Loading

0 comments on commit c2a12ed

Please sign in to comment.