CVS update: php3/functions
| From: | steinm | Date: | Tue, 03 Nov 1998 17:00:34 +0000 |
| Subject: | CVS update: php3/functions | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-2165@lists.php.net to get a copy of this message | ||
Date: Tuesday November 3, 1998 @ 12:00
Author: steinm
Update of /repository/php3/functions
In directory asf:/u2/tmp/cvs-serv1164/functions
Modified Files:
pdf.c php3_pdf.h
Log Message:
more documentation, more pdf functions
Index: php3/functions/pdf.c
diff -c php3/functions/pdf.c:1.5 php3/functions/pdf.c:1.6
*** php3/functions/pdf.c:1.5 Wed Oct 28 01:49:11 1998
--- php3/functions/pdf.c Tue Nov 3 12:00:26 1998
***************
*** 27,35 ****
+----------------------------------------------------------------------+
*/
! /* $Id: pdf.c,v 1.5 1998/10/28 06:49:11 shane Exp $ */
! /* pdflib 0.4 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
/* Note that there is no code from the pdflib package in this file */
--- 27,35 ----
+----------------------------------------------------------------------+
*/
! /* $Id: pdf.c,v 1.6 1998/11/03 17:00:26 steinm Exp $ */
! /* pdflib 0.6 is subject to the ALADDIN FREE PUBLIC LICENSE.
Copyright (C) 1997 Thomas Merz. */
/* Note that there is no code from the pdflib package in this file */
***************
*** 95,101 ****
{"pdf_set_text_rendering", php3_pdf_set_text_rendering,NULL},
{"pdf_set_horiz_scaling", php3_pdf_set_horiz_scaling, NULL},
{"pdf_set_text_rise", php3_pdf_set_text_rise, NULL},
! // {"pdf_set_text_matrix", php3_pdf_set_text_matrix, NULL},
{"pdf_set_text_pos", php3_pdf_set_text_pos, NULL},
{"pdf_set_char_spacing", php3_pdf_set_char_spacing, NULL},
{"pdf_set_word_spacing", php3_pdf_set_word_spacing, NULL},
--- 95,101 ----
{"pdf_set_text_rendering", php3_pdf_set_text_rendering,NULL},
{"pdf_set_horiz_scaling", php3_pdf_set_horiz_scaling, NULL},
{"pdf_set_text_rise", php3_pdf_set_text_rise, NULL},
! {"pdf_set_text_matrix", php3_pdf_set_text_matrix, NULL},
{"pdf_set_text_pos", php3_pdf_set_text_pos, NULL},
{"pdf_set_char_spacing", php3_pdf_set_char_spacing, NULL},
{"pdf_set_word_spacing", php3_pdf_set_word_spacing, NULL},
***************
*** 132,137 ****
--- 132,140 ----
{"pdf_setrgbcolor_fill", php3_pdf_setrgbcolor_fill, NULL},
{"pdf_setrgbcolor_stroke", php3_pdf_setrgbcolor_stroke,NULL},
{"pdf_setrgbcolor", php3_pdf_setrgbcolor, NULL},
+ {"pdf_add_outline", php3_pdf_add_outline, NULL},
+ {"pdf_set_transition", php3_pdf_set_transition, NULL},
+ {"pdf_set_duration", php3_pdf_set_duration, NULL},
{NULL, NULL, NULL}
};
***************
*** 328,334 ****
convert_to_long(info);
id=file->value.lval;
fp = php3_list_find(id,&type);
! if (!fp || type!=GLOBAL(le_pdf)) {
php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);
RETURN_FALSE;
}
--- 331,337 ----
convert_to_long(info);
id=file->value.lval;
fp = php3_list_find(id,&type);
! if (!fp || type!=GLOBAL(le_fp)) {
php3_error(E_WARNING,"Unable to find file identifier %d (type=%d)",id, type);
RETURN_FALSE;
}
***************
*** 594,599 ****
--- 597,648 ----
RETURN_TRUE;
}
+ void php3_pdf_set_text_matrix(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *arg1, *arg2, *data;
+ int id, type, i;
+ HashTable *matrix;
+ PDF *pdf;
+ PDF_matrix pdfmatrix;
+ float *pdfmatrixptr;
+ PDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_array(arg2);
+ id=arg1->value.lval;
+ matrix=arg2->value.ht;
+ pdf = php3_list_find(id,&type);
+ if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ if(_php3_hash_num_elements(matrix) != 6) {
+ php3_error(E_WARNING,"Text matrix must have 6 elements");
+ RETURN_FALSE;
+ }
+
+ pdfmatrixptr = (float *) &pdfmatrix;
+ _php3_hash_internal_pointer_reset(matrix);
+ for(i=0; i<_php3_hash_num_elements(matrix); i++) {
+ _php3_hash_get_current_data(matrix, (void *) &data);
+ switch(data->type) {
+ case IS_DOUBLE:
+ *pdfmatrixptr++ = (float) data->value.dval;
+ default:
+ *pdfmatrixptr++ = 0.0;
+ }
+ _php3_hash_move_forward(matrix);
+ }
+
+ PDF_set_text_matrix(pdf, pdfmatrix);
+
+ RETURN_TRUE;
+ }
+
void php3_pdf_set_text_pos(INTERNAL_FUNCTION_PARAMETERS) {
pval *arg1, *arg2, *arg3;
int id, type;
***************
*** 1499,1504 ****
--- 1548,1626 ----
RETURN_TRUE;
}
+
+ void php3_pdf_add_outline(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *arg1, *arg2;
+ int id, type;
+ PDF *pdf;
+ PDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_string(arg2);
+ id=arg1->value.lval;
+ pdf = php3_list_find(id,&type);
+ if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ PDF_add_outline(pdf, arg2->value.str.val);
+
+ RETURN_TRUE;
+ }
+
+ void php3_pdf_set_transition(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *arg1, *arg2;
+ int id, type;
+ PDF *pdf;
+ PDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_long(arg2);
+ id=arg1->value.lval;
+ pdf = php3_list_find(id,&type);
+ if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ PDF_set_transition(pdf, arg2->value.lval);
+
+ RETURN_TRUE;
+ }
+
+ void php3_pdf_set_duration(INTERNAL_FUNCTION_PARAMETERS) {
+ pval *arg1, *arg2;
+ int id, type;
+ PDF *pdf;
+ PDF_TLS_VARS;
+
+ if (ARG_COUNT(ht) != 2 || getParameters(ht, 2, &arg1, &arg2) == FAILURE) {
+ WRONG_PARAM_COUNT;
+ }
+
+ convert_to_long(arg1);
+ convert_to_double(arg2);
+ id=arg1->value.lval;
+ pdf = php3_list_find(id,&type);
+ if(!pdf || type!=PDF_GLOBAL(le_pdf)) {
+ php3_error(E_WARNING,"Unable to find file identifier %d",id);
+ RETURN_FALSE;
+ }
+
+ PDF_set_duration(pdf, (float) arg2->value.dval);
+
+ RETURN_TRUE;
+ }
+
#endif
/*
Index: php3/functions/php3_pdf.h
diff -c php3/functions/php3_pdf.h:1.3 php3/functions/php3_pdf.h:1.4
*** php3/functions/php3_pdf.h:1.3 Tue Oct 20 08:40:22 1998
--- php3/functions/php3_pdf.h Tue Nov 3 12:00:32 1998
***************
*** 26,32 ****
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
! /* $Id: php3_pdf.h,v 1.3 1998/10/20 12:40:22 steinm Exp $ */
#ifndef _PHP3_PDF_H
#define _PHP3_PDF_H
--- 26,32 ----
| Authors: Uwe Steinmann |
+----------------------------------------------------------------------+
*/
! /* $Id: php3_pdf.h,v 1.4 1998/11/03 17:00:32 steinm Exp $ */
#ifndef _PHP3_PDF_H
#define _PHP3_PDF_H
***************
*** 60,65 ****
--- 60,66 ----
extern void php3_pdf_set_text_rendering(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_set_horiz_scaling(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_set_text_rise(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_pdf_set_text_matrix(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_set_text_pos(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_set_char_spacing(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_set_word_spacing(INTERNAL_FUNCTION_PARAMETERS);
***************
*** 96,101 ****
--- 97,105 ----
extern void php3_pdf_setrgbcolor_fill(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_setrgbcolor_stroke(INTERNAL_FUNCTION_PARAMETERS);
extern void php3_pdf_setrgbcolor(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_pdf_add_outline(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_pdf_set_transition(INTERNAL_FUNCTION_PARAMETERS);
+ extern void php3_pdf_set_duration(INTERNAL_FUNCTION_PARAMETERS);
#else
#define pdf_module_ptr NULL
#endif
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net