2005-03-21 07:51:16 +03:00
|
|
|
# data file for the Fltk User Interface Designer (fluid)
|
2016-01-30 03:56:42 +03:00
|
|
|
version 1.0400
|
2015-07-09 05:09:33 +03:00
|
|
|
header_name {.h}
|
2005-03-21 07:51:16 +03:00
|
|
|
code_name {.cxx}
|
|
|
|
comment {//
|
|
|
|
// FLUID print panel for the Fast Light Tool Kit (FLTK).
|
|
|
|
//
|
2020-04-06 21:04:16 +03:00
|
|
|
// Copyright 1998-2020 by Bill Spitzak and others.
|
2005-03-21 07:51:16 +03:00
|
|
|
//
|
2011-07-19 08:49:30 +04:00
|
|
|
// This library is free software. Distribution and use rights are outlined in
|
|
|
|
// the file "COPYING" which should have been included with this file. If this
|
|
|
|
// file is missing or damaged, see the license at:
|
2005-03-21 07:51:16 +03:00
|
|
|
//
|
2020-04-06 21:04:16 +03:00
|
|
|
// https://www.fltk.org/COPYING.php
|
2005-03-21 07:51:16 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// Please see the following page on how to report bugs and issues:
|
2005-03-21 07:51:16 +03:00
|
|
|
//
|
2020-07-01 19:03:10 +03:00
|
|
|
// https://www.fltk.org/bugs.php
|
2005-03-21 07:51:16 +03:00
|
|
|
//
|
|
|
|
} {in_source in_header
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2014-10-05 04:03:27 +04:00
|
|
|
decl {\#include <stdio.h>} {private local
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2014-10-05 04:03:27 +04:00
|
|
|
decl {\#include <stdlib.h>} {private local
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2014-10-05 04:03:27 +04:00
|
|
|
decl {\#include "../src/flstring.h"} {private local
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2020-07-22 06:15:41 +03:00
|
|
|
decl {\#include <FL/fl_string.h>} {private local
|
|
|
|
}
|
|
|
|
|
2014-10-05 04:03:27 +04:00
|
|
|
decl {\#include <FL/Fl_Preferences.H>} {private local
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2014-10-05 04:03:27 +04:00
|
|
|
decl {extern Fl_Preferences fluid_prefs;} {private local
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
|
|
|
Function {make_print_panel()} {open
|
|
|
|
} {
|
|
|
|
Fl_Window print_panel {
|
|
|
|
label Print open
|
2015-03-10 04:41:55 +03:00
|
|
|
xywh {394 209 465 235} type Double hide modal
|
2005-03-21 07:51:16 +03:00
|
|
|
} {
|
|
|
|
Fl_Group print_panel_controls {open
|
|
|
|
xywh {10 10 447 216}
|
|
|
|
} {
|
|
|
|
Fl_Choice print_choice {
|
|
|
|
label {Printer:}
|
2005-03-21 20:34:03 +03:00
|
|
|
callback {print_update_status();} open
|
2005-03-21 07:51:16 +03:00
|
|
|
xywh {113 10 181 25} down_box BORDER_BOX labelfont 1 when 1
|
|
|
|
} {}
|
|
|
|
Fl_Button print_properties {
|
|
|
|
label {Properties...}
|
2020-07-01 19:03:10 +03:00
|
|
|
callback {print_properties_panel->show();}
|
2005-03-21 07:51:16 +03:00
|
|
|
xywh {294 10 105 25}
|
|
|
|
}
|
|
|
|
Fl_Box print_status {
|
|
|
|
label {printer/job status}
|
|
|
|
xywh {111 41 288 17} align 84
|
|
|
|
}
|
|
|
|
Fl_Group {} {
|
|
|
|
label {Print Range} open
|
|
|
|
xywh {10 86 227 105} box THIN_DOWN_BOX labelfont 1 align 5
|
|
|
|
} {
|
|
|
|
Fl_Round_Button print_all {
|
|
|
|
label All
|
|
|
|
callback {print_from->deactivate();
|
|
|
|
print_to->deactivate();}
|
|
|
|
xywh {20 96 38 25} type Radio down_box ROUND_DOWN_BOX value 1
|
|
|
|
}
|
|
|
|
Fl_Round_Button print_pages {
|
|
|
|
label Pages
|
|
|
|
callback {print_from->activate();
|
|
|
|
print_to->activate();}
|
|
|
|
xywh {20 126 64 25} type Radio down_box ROUND_DOWN_BOX
|
|
|
|
}
|
|
|
|
Fl_Round_Button print_selection {
|
|
|
|
label Selection
|
|
|
|
callback {print_from->deactivate();
|
|
|
|
print_to->deactivate();}
|
|
|
|
xywh {20 156 82 25} type Radio down_box ROUND_DOWN_BOX
|
|
|
|
}
|
|
|
|
Fl_Input print_from {
|
|
|
|
label {From:}
|
|
|
|
xywh {136 126 28 25} type Int textfont 4 deactivate
|
|
|
|
}
|
|
|
|
Fl_Input print_to {
|
|
|
|
label {To:}
|
|
|
|
xywh {199 126 28 25} type Int textfont 4 deactivate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Group {} {
|
|
|
|
label Copies open
|
|
|
|
xywh {247 86 210 105} box THIN_DOWN_BOX labelfont 1 align 5
|
|
|
|
} {
|
|
|
|
Fl_Spinner print_copies {
|
|
|
|
label {\# Copies:}
|
|
|
|
callback {if (print_copies->value() == 1) {
|
|
|
|
print_collate_button->deactivate();
|
|
|
|
print_collate_group[0]->deactivate();
|
|
|
|
print_collate_group[1]->deactivate();
|
|
|
|
} else {
|
|
|
|
print_collate_button->activate();
|
|
|
|
print_collate_group[0]->activate();
|
|
|
|
print_collate_group[1]->activate();
|
2014-10-05 04:03:27 +04:00
|
|
|
}}
|
2005-03-25 05:39:25 +03:00
|
|
|
xywh {321 96 45 25} when 1
|
2005-03-21 07:51:16 +03:00
|
|
|
}
|
|
|
|
Fl_Check_Button print_collate_button {
|
|
|
|
label Collate
|
|
|
|
callback {int i = print_collate_button->value() != 0;
|
|
|
|
print_collate_group[i]->show();
|
|
|
|
print_collate_group[1 - i]->hide();}
|
|
|
|
xywh {376 96 64 25} down_box DOWN_BOX when 1 deactivate
|
|
|
|
}
|
|
|
|
Fl_Group {print_collate_group[0]} {
|
|
|
|
xywh {257 131 191 50} deactivate
|
|
|
|
} {
|
|
|
|
Fl_Box {} {
|
|
|
|
label 1
|
|
|
|
xywh {287 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 1
|
|
|
|
xywh {272 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 1
|
|
|
|
xywh {257 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 2
|
|
|
|
xywh {352 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 2
|
|
|
|
xywh {337 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 2
|
|
|
|
xywh {322 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 3
|
|
|
|
xywh {417 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 3
|
|
|
|
xywh {402 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 3
|
|
|
|
xywh {387 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26 deactivate
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Group {print_collate_group[1]} {
|
|
|
|
xywh {257 131 191 50} hide deactivate
|
|
|
|
} {
|
|
|
|
Fl_Box {} {
|
|
|
|
label 3
|
|
|
|
xywh {287 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 2
|
|
|
|
xywh {272 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 1
|
|
|
|
xywh {257 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 3
|
|
|
|
xywh {352 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 2
|
|
|
|
xywh {337 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 1
|
|
|
|
xywh {322 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 3
|
|
|
|
xywh {417 141 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 2
|
|
|
|
xywh {402 136 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
Fl_Box {} {
|
|
|
|
label 1
|
|
|
|
xywh {387 131 30 40} box BORDER_BOX color 7 labelsize 11 align 26
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Return_Button {} {
|
|
|
|
label Print
|
|
|
|
callback print_cb
|
|
|
|
xywh {309 201 70 25}
|
|
|
|
}
|
|
|
|
Fl_Button {} {
|
|
|
|
label Cancel
|
|
|
|
callback {print_panel->hide();}
|
|
|
|
xywh {389 201 68 25}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Progress print_progress {
|
|
|
|
xywh {10 203 289 21} selection_color 4 hide
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Window print_properties_panel {
|
|
|
|
label {Printer Properties}
|
|
|
|
callback {print_properties_panel->hide();
|
|
|
|
print_update_status();} open
|
2015-03-10 04:41:55 +03:00
|
|
|
xywh {400 537 290 130} type Double hide modal
|
2005-03-21 07:51:16 +03:00
|
|
|
} {
|
|
|
|
Fl_Choice print_page_size {
|
|
|
|
label {Page Size:}
|
2014-05-18 00:46:25 +04:00
|
|
|
xywh {110 10 80 25} down_box BORDER_BOX labelfont 1 labelsize 12
|
2005-03-21 07:51:16 +03:00
|
|
|
} {
|
|
|
|
MenuItem {} {
|
|
|
|
label Letter
|
|
|
|
xywh {0 0 35 25}
|
|
|
|
}
|
|
|
|
MenuItem {} {
|
|
|
|
label A4
|
|
|
|
xywh {0 0 35 25}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Group {} {
|
2005-03-21 22:57:50 +03:00
|
|
|
label {Output Mode:} open
|
2014-05-18 00:46:25 +04:00
|
|
|
xywh {110 45 170 40} labelfont 1 labelsize 12 align 4
|
2005-03-21 07:51:16 +03:00
|
|
|
} {
|
2005-03-21 22:59:45 +03:00
|
|
|
Fl_Button {print_output_mode[0]} {
|
2005-03-21 07:51:16 +03:00
|
|
|
image {pixmaps/print_color.xpm} xywh {110 45 30 40} type Radio box BORDER_BOX down_box BORDER_BOX value 1 color 7 selection_color 0
|
|
|
|
}
|
|
|
|
Fl_Button {print_output_mode[1]} {
|
2005-03-21 22:57:50 +03:00
|
|
|
image {pixmaps/print_color.xpm} xywh {150 50 40 30} type Radio box BORDER_BOX down_box BORDER_BOX color 7 selection_color 0
|
2005-03-21 07:51:16 +03:00
|
|
|
}
|
|
|
|
Fl_Button {print_output_mode[2]} {
|
2005-03-21 22:57:50 +03:00
|
|
|
image {pixmaps/print_gray.xpm} xywh {200 45 30 40} type Radio box BORDER_BOX down_box BORDER_BOX color 7 selection_color 0
|
2005-03-21 07:51:16 +03:00
|
|
|
}
|
|
|
|
Fl_Button {print_output_mode[3]} {
|
|
|
|
image {pixmaps/print_gray.xpm} xywh {240 50 40 30} type Radio box BORDER_BOX down_box BORDER_BOX color 7 selection_color 0
|
|
|
|
}
|
|
|
|
}
|
|
|
|
Fl_Return_Button {} {
|
|
|
|
label Save
|
|
|
|
callback {print_properties_panel->hide();
|
|
|
|
|
|
|
|
char name[1024];
|
|
|
|
int val;
|
2005-03-21 20:34:03 +03:00
|
|
|
const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2005-03-21 20:34:03 +03:00
|
|
|
snprintf(name, sizeof(name), "%s/page_size", printer);
|
2005-03-21 07:51:16 +03:00
|
|
|
fluid_prefs.set(name, print_page_size->value());
|
|
|
|
|
2005-03-21 20:34:03 +03:00
|
|
|
snprintf(name, sizeof(name), "%s/output_mode", printer);
|
2005-03-21 07:51:16 +03:00
|
|
|
for (val = 0; val < 4; val ++) {
|
|
|
|
if (print_output_mode[val]->value()) break;
|
|
|
|
}
|
|
|
|
fluid_prefs.set(name, val);}
|
|
|
|
xywh {123 95 79 25}
|
|
|
|
}
|
|
|
|
Fl_Button {} {
|
|
|
|
label Cancel
|
|
|
|
callback {print_properties_panel->hide();
|
|
|
|
print_update_status();}
|
|
|
|
xywh {212 95 68 25}
|
|
|
|
}
|
2005-03-21 22:59:45 +03:00
|
|
|
Fl_Button {} {
|
|
|
|
label Use
|
2005-03-25 05:39:25 +03:00
|
|
|
callback {print_properties_panel->hide();}
|
2005-03-21 22:59:45 +03:00
|
|
|
xywh {60 95 53 25}
|
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
}
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2014-10-05 04:03:27 +04:00
|
|
|
decl {void print_cb(Fl_Return_Button *, void *);} {public local
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
2005-03-21 20:34:03 +03:00
|
|
|
Function {print_load()} {open return_type void
|
2005-03-21 07:51:16 +03:00
|
|
|
} {
|
|
|
|
code {FILE *lpstat;
|
2005-03-21 20:34:03 +03:00
|
|
|
char line[1024], name[1024], *nptr, qname[2048], *qptr, defname[1024];
|
2005-03-21 07:51:16 +03:00
|
|
|
int i;
|
|
|
|
|
2005-03-21 20:34:03 +03:00
|
|
|
if (print_choice->size() > 1) {
|
|
|
|
for (i = 1; print_choice->text(i); i ++) {
|
|
|
|
free(print_choice->menu()[i].user_data());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2005-03-21 07:51:16 +03:00
|
|
|
print_choice->clear();
|
|
|
|
print_choice->add("Print To File", 0, 0, 0, FL_MENU_DIVIDER);
|
|
|
|
print_choice->value(0);
|
|
|
|
|
|
|
|
defname[0] = '\\0';
|
|
|
|
|
2010-03-06 00:18:18 +03:00
|
|
|
if ((lpstat = popen("LC_MESSAGES=C LANG=C lpstat -p -d", "r")) != NULL) {
|
2005-03-21 07:51:16 +03:00
|
|
|
while (fgets(line, sizeof(line), lpstat)) {
|
|
|
|
if (!strncmp(line, "printer ", 8) &&
|
|
|
|
sscanf(line + 8, "%s", name) == 1) {
|
2005-03-21 20:34:03 +03:00
|
|
|
for (nptr = name, qptr = qname; *nptr; *qptr++ = *nptr++) {
|
|
|
|
if (*nptr == '/') *qptr++ = '\\\\';
|
|
|
|
}
|
|
|
|
*qptr = '\\0';
|
|
|
|
|
2020-07-22 06:15:41 +03:00
|
|
|
print_choice->add(qname, 0, 0, (void *)fl_strdup(name), 0);
|
2005-03-21 07:51:16 +03:00
|
|
|
} else if (!strncmp(line, "system default destination: ", 28)) {
|
|
|
|
if (sscanf(line + 28, "%s", defname) != 1) defname[0] = '\\0';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
pclose(lpstat);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (defname[0]) {
|
|
|
|
for (i = 1; print_choice->text(i); i ++) {
|
2005-03-21 20:34:03 +03:00
|
|
|
if (!strcmp((char *)print_choice->menu()[i].user_data(), defname)) {
|
2005-03-21 07:51:16 +03:00
|
|
|
print_choice->value(i);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2005-03-21 20:34:03 +03:00
|
|
|
} else if (print_choice->size() > 2) print_choice->value(1);
|
2005-03-21 07:51:16 +03:00
|
|
|
|
|
|
|
|
|
|
|
print_update_status();} {}
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|
2005-03-21 07:51:16 +03:00
|
|
|
|
|
|
|
Function {print_update_status()} {open return_type void
|
|
|
|
} {
|
|
|
|
code {FILE *lpstat;
|
|
|
|
char command[1024];
|
|
|
|
static char status[1024];
|
2005-03-21 20:34:03 +03:00
|
|
|
const char *printer = (const char *)print_choice->menu()[print_choice->value()].user_data();
|
2005-03-21 07:51:16 +03:00
|
|
|
|
|
|
|
if (print_choice->value()) {
|
2005-03-21 20:34:03 +03:00
|
|
|
snprintf(command, sizeof(command), "lpstat -p '%s'", printer);
|
2005-03-21 07:51:16 +03:00
|
|
|
if ((lpstat = popen(command, "r")) != NULL) {
|
2010-10-29 01:47:01 +04:00
|
|
|
if (fgets(status, sizeof(status), lpstat)==0) { /* ignore */ }
|
2005-03-21 07:51:16 +03:00
|
|
|
pclose(lpstat);
|
|
|
|
} else strcpy(status, "printer status unavailable");
|
|
|
|
} else status[0] = '\\0';
|
|
|
|
|
|
|
|
print_status->label(status);
|
|
|
|
|
|
|
|
char name[1024];
|
|
|
|
int val;
|
|
|
|
|
2005-03-21 20:34:03 +03:00
|
|
|
snprintf(name, sizeof(name), "%s/page_size", printer);
|
2005-03-21 07:51:16 +03:00
|
|
|
fluid_prefs.get(name, val, 0);
|
|
|
|
print_page_size->value(val);
|
|
|
|
|
2005-03-21 20:34:03 +03:00
|
|
|
snprintf(name, sizeof(name), "%s/output_mode", printer);
|
2005-03-21 07:51:16 +03:00
|
|
|
fluid_prefs.get(name, val, 0);
|
2005-03-21 22:57:50 +03:00
|
|
|
print_output_mode[val]->setonly();} {}
|
2015-07-09 05:09:33 +03:00
|
|
|
}
|