Re: task request



Nathan Cullen wrote:

On Sat, Mar 24, 2001 at 12:19:50PM -0600, Chema Celorio wrote:
Taks : Add a more featurfull print dialog to ghex. A range frame and a
print preview button
Assigned to : furyu fuse net

Deatails :

We need to add 2 more features to the ghex print dialog, this features
are :
- Printing a range of pages
- A print preview button

In order to add this features, the internal code to print has to be
reorganize. We are going to use the code inside cvs/gedit/src/print.c
as a base for the new structure of the printing code for ghex. For
example,
the function "print_document" should be divided in

ghex_print
ghex_print_job_info_new
ghex_print_job_info_destroy
ghex_print_preview_real
ghex_print_run_dialog

the only difference you are going to find is that print.c inside ghex
should not contain gui code. Ghex ui code should be inside ui.c. So
the functions _print,_run_dialog,_preview_real should go inside ui.c.
gedit has a progress bar that shows when we print over 30 pages, we
don't need a progress bar inside ghex.

let me know if you have any questions.

Okay, I looked over the ghex, ghex, and gnome-print modules and I came
across a few questions:

1.  ghex uses gnome_printer_dialog_new().  Since this dialog is in
gnome-print, I can't just easily edit a glade/resource to add a new
button.  

ghex is not using glade for doing the interfaces. The interfaces
are hand coded. 

or does there seem to be a method or style to add the Preview
button to the dialog.  However, I did notice in gnome-print there is a
gnome_print_dialog_new(title, flags) wherein one of the flags is a

yes, you neeed to create the ghex dialog with gnome_print_dialog_new

preview button flag.  What is the difference between a GnomePrintDialog
and a GnomePrinterDialog?  

GnomePrinterDialog is the not so featurefull one. it is the minimum.
GnomePrintDialog contains a GnomePrinterDialog inside it

The gedit code uses GnomePrintDialog and that
seems to be what is necessary, but I just want to be sure.

yes that is what you need


2. In gedit's print.c, the function implementations are documented.  For
every function, there is a "@pji" under the function name.  What is this
for?  Is this necesary for my comments?  Is there a specific way to
document methods?

(for example)

/**
 * gedit_print_range_is_selection:
 * @pji: 
 * @start: 
 * @end: 
 * 
 * 
 **/
static void
gedit_print_range_is_selection (PrintJobInfo *pji, guint start, guint
end)


the @something are the parameters for that function. This funcion is not
really
documented it should be for example :


/**
 * gedit_print_range_is_selection:
 * @pji: The PrintJobInfo strucutre with all the print values
 * @start: the start of the range of pages to print
 * @end: the end of the range
 * 
 * Print only a range, this funciton modifies the @pji structure so that
only
 * the selected range is printed
 **/
static void
gedit_print_range_is_selection (PrintJobInfo *pji, guint start, guint
end)
{

if you use emacs you can grab my .emacs file from
http://www.gnome.org/~chema/.emacs
and inside a fucntion type "CTRL-X 4h" to create the header
automatically for 
you. There is program called gtk-doc, that takes this headers and makes
documentation
for the API. For example, this webpage was created from this comments :
http://developer.gnome.org/doc/API/gdk-pixbuf/gdk-pixbuf-file-loading.html


3.  When I'm done, should I submit a patch to you or to the gnome-love
list?  Both?

both,
this kinds of questions also send to the list so that people can browse
the
archives or learn about this kind of details. I am cc:'ing the list now.


regards,
Chema


--
Nathan Cullen
furyu fuse net




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]