Lines Matching refs:job_params
148 wprint_job_params_t job_params;
468 if (jq->job_params.useragent != NULL) {
469 free((void *) jq->job_params.useragent);
569 jq->job_params.cancelled = true;
601 jq->job_params.cancelled = true;
729 jq->job_params.plugin_data = NULL;
788 } else if (!jq->job_params.cancelled) {
820 if (jq->job_params.cancelled) {
825 if (jq->job_params.cancelled) {
858 jq->job_params.page_num = -1;
863 job_result = jq->print_ifc->validate_job(jq->print_ifc, &jq->job_params);
872 (strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) != 0)) {
873 jq->print_ifc->start_job(jq->print_ifc, &jq->job_params);
880 (void *) jq->print_ifc, &(jq->job_params));
885 jq->job_params.page_num = 0;
891 for (i = 0; (i < jq->job_params.num_copies) &&
893 (!jq->job_params.cancelled); i++) {
895 jq->job_params.copies_supported &&
896 (strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) == 0)) {
902 (strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) == 0)) {
903 jq->print_ifc->start_job(jq->print_ifc, &jq->job_params);
929 if (page.last_page && ((i == jq->job_params.num_copies - 1) ||
930 (jq->job_params.copies_supported &&
931 strcmp(jq->job_params.print_format,
933 jq->job_params.last_page = page.last_page;
935 jq->job_params.last_page = false;
941 jq->job_params
944 jq->job_params.page_num = page.page_num;
946 jq->job_params.page_num = per_copy_page_num;
950 jq->job_params.print_top_margin += page.top_margin;
951 jq->job_params.print_left_margin += page.left_margin;
952 jq->job_params.print_right_margin += page.right_margin;
953 jq->job_params.print_bottom_margin += page.bottom_margin;
955 jq->job_params.copy_num = (i + 1);
956 jq->job_params.copy_page_num = page.page_num;
957 jq->job_params.page_backside = (per_copy_page_num & 0x1);
958 jq->job_params.page_corrupted = (page.corrupted ? 1 : 0);
959 jq->job_params.page_printing = true;
965 if (strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) != 0) {
966 job_result = jq->plugin->print_page(&(jq->job_params),
972 job_result = jq->plugin->print_page(&(jq->job_params),
981 if ((jq->job_params.duplex != DUPLEX_MODE_NONE) &&
983 jq->plugin->print_blank_page(job_handle, &(jq->job_params));
988 jq->job_params.print_top_margin -= page.top_margin;
989 jq->job_params.print_left_margin -= page.left_margin;
990 jq->job_params.print_right_margin -= page.right_margin;
991 jq->job_params.print_bottom_margin -= page.bottom_margin;
992 jq->job_params.page_printing = false;
1002 if (page.last_page && (jq->job_params.duplex != DUPLEX_MODE_NONE)
1003 && (jq->job_params.page_backside)
1006 jq->plugin->print_blank_page(job_handle, &(jq->job_params));
1011 if (jq->saveQ && !jq->job_params.cancelled && (job_result != ERROR)) {
1016 if (page.last_page && !jq->job_params.last_page) {
1030 if (page.last_page || jq->job_params.cancelled) {
1039 if ((strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) == 0) &&
1053 for (i = 0; ((i < jq->job_params.num_copies) && (job_result == OK)); i++) {
1054 if ((i > 0) && jq->job_params.copies_supported &&
1055 (strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) == 0)) {
1069 jq->job_params.page_num++;
1070 jq->job_params.last_page = (i == (jq->job_params.num_copies - 1));
1071 jq->job_params.copy_num = (i + 1);
1072 jq->job_params.copy_page_num = 1;
1073 jq->job_params.page_corrupted = (job_result == CORRUPT);
1074 jq->job_params.page_printing = true;
1077 job_result = jq->plugin->print_page(&(jq->job_params), jq->mime_type,
1080 if ((jq->job_params.duplex != DUPLEX_MODE_NONE)
1083 &(jq->job_params));
1087 jq->job_params.page_printing = false;
1094 if (jq->job_params.page_num >= 0) {
1096 if ((jq->job_params.page_num == 0)
1098 jq->plugin->print_blank_page(job_handle, &(jq->job_params));
1101 jq->plugin->end_job(&(jq->job_params));
1104 (strcmp(jq->job_params.print_format, PRINT_FORMAT_PDF) != 0)) {
1117 if ((jq->job_params.page_num > 0) && (jq->status_ifc != NULL)) {
1134 if (jq->job_params.cancelled && !jq->cancel_ok) {
1146 if (!jq->job_params.cancelled &&
1165 jq->job_params.page_num = MAX(0, jq->job_params.page_num);
1181 if (!jq->job_params.cancelled) {
1203 jq->mime_type, jq->job_params.print_format);
1524 static char *_get_print_format(const char *mime_type, const wprint_job_params_t *job_params,
1533 if (job_params && (strcasecmp(job_params->docCategory, "photo") == 0) &&
1561 status_t wprintGetDefaultJobParams(wprint_job_params_t *job_params) {
1573 if (job_params == NULL) return result;
1575 memcpy(job_params, &_default_job_params, sizeof(_default_job_params));
1580 status_t wprintGetFinalJobParams(wprint_job_params_t *job_params,
1586 if (job_params == NULL) {
1591 job_params->accepts_pclm = printer_cap->canPrintPCLm;
1592 job_params->accepts_pdf = printer_cap->canPrintPDF;
1593 job_params->media_default = printer_cap->mediaDefault;
1596 job_params->epcl_ipp_supported = true;
1600 job_params->copies_supported = true;
1604 job_params->ipp_1_0_supported = true;
1605 job_params->ipp_2_0_supported = true;
1607 job_params->ipp_1_0_supported = true;
1608 job_params->ipp_2_0_supported = false;
1612 job_params->color_space = COLOR_SPACE_MONO;
1616 job_params->pcl_type = PCLm;
1619 job_params->pcl_type = PCLPWG;
1623 job_params->pcl_type = PCLPWG;
1626 LOGD("wprintGetFinalJobParams: Using PCL Type %s", getPCLTypeString(job_params->pcl_type));
1629 job_params->strip_height = printer_cap->stripHeight;
1632 if (job_params->num_copies <= 0) {
1633 job_params->num_copies = 1;
1638 if (job_params->media_size == printer_cap->supportedMediaSizes[i]) {
1644 job_params->media_size = ISO_A4;
1645 job_params->media_tray = TRAY_SRC_AUTO_SELECT;
1650 if (job_params->media_tray == printer_cap->supportedMediaTrays[i]) {
1657 job_params->media_tray = TRAY_SRC_AUTO_SELECT;
1661 job_params->media_size_name = true;
1663 job_params->media_size_name = false;
1667 if ((job_params->borderless == true) && !printer_cap->borderless) {
1668 job_params->borderless = false;
1672 if (job_params->borderless &&
1673 ((job_params->job_top_margin > 0.0f) || (job_params->job_left_margin > 0.0f) ||
1674 (job_params->job_right_margin > 0.0f)
1675 || (job_params->job_bottom_margin > 0.0f))) {
1676 job_params->borderless = false;
1680 if ((job_params->duplex != DUPLEX_MODE_NONE) && !printer_cap->duplex) {
1681 job_params->duplex = DUPLEX_MODE_NONE;
1685 if (job_params->borderless && (job_params->duplex != DUPLEX_MODE_NONE)) {
1686 job_params->duplex = DUPLEX_MODE_NONE;
1689 if ((job_params->duplex == DUPLEX_MODE_BOOK)
1691 job_params->render_flags |= RENDER_FLAG_ROTATE_BACK_PAGE;
1694 if (job_params->render_flags & RENDER_FLAG_ROTATE_BACK_PAGE) {
1698 if ((job_params->duplex == DUPLEX_MODE_NONE) && !printer_cap->faceDownTray) {
1699 job_params->renderInReverseOrder = true;
1701 job_params->renderInReverseOrder = false;
1704 if (job_params->render_flags & RENDER_FLAG_AUTO_SCALE) {
1705 job_params->render_flags |= AUTO_SCALE_RENDER_FLAGS;
1706 } else if (job_params->render_flags & RENDER_FLAG_AUTO_FIT) {
1707 job_params->render_flags |= AUTO_FIT_RENDER_FLAGS;
1710 job_params->pixel_units = _findCloseResolutionSupported(DEFAULT_RESOLUTION,
1713 printable_area_get_default_margins(job_params, printer_cap, &margins[TOP_MARGIN],
1715 printable_area_get(job_params, margins[TOP_MARGIN], margins[LEFT_MARGIN], margins[RIGHT_MARGIN],
1718 job_params->accepts_app_name = printer_cap->docSourceAppName;
1719 job_params->accepts_app_version = printer_cap->docSourceAppVersion;
1720 job_params->accepts_os_name = printer_cap->docSourceOsName;
1721 job_params->accepts_os_version = printer_cap->docSourceOsVersion;
1727 const wprint_job_params_t *job_params, const printer_capabilities_t *printer_cap,
1744 print_format = _get_print_format(mime_type, job_params, printer_cap);
1760 // Make sure we have job_params
1761 if (job_params == NULL) {
1810 memcpy((char *) &(jq->job_params), job_params, sizeof(wprint_job_params_t));
1812 size_t useragent_len = strlen(USERAGENT_PREFIX) + strlen(jq->job_params.docCategory) + 1;
1815 snprintf(useragent, useragent_len, USERAGENT_PREFIX "%s", jq->job_params.docCategory);
1816 jq->job_params.useragent = useragent;
1819 jq->job_params.page_num = 0;
1820 jq->job_params.print_format = print_format;
1823 jq->job_params.pcl_type = PCLm;
1825 jq->job_params.pcl_type = PCLNONE;
1831 jq->job_params.pcl_type = PCLPWG;
1833 jq->job_params.pcl_type = PCLNONE;
1846 if (jq->job_params.num_copies > 1) {
2004 jq->job_params.cancelled = true;
2008 if ((jq->job_state != JOB_STATE_BLOCKED) || (jq->job_params.page_num != 0)) {
2011 jq->job_params.job_originating_user_name) == 0);
2034 jq->job_params.cancelled = true;