debian/0000755000000000000000000000000011515532575007177 5ustar debian/control0000644000000000000000000000116611515532620010575 0ustar Source: xtrkcad Section: editors Priority: optional Maintainer: Ubuntu Developers XSBC-Original-Maintainer: Daniel E. Markle Build-Depends: debhelper (>= 5), libglib2.0-dev, libgtk2.0-dev, libx11-dev, netpbm, imagemagick, libwebkitgtk-dev, cmake Standards-Version: 3.8.4 Package: xtrkcad Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: Model Train Track CAD Program This program allows you to design model train layouts. It is fundamentally a drawing (CAD) program, but tailored to some of the specific issues in the model train world. debian/menu0000644000000000000000000000025511426522651010063 0ustar ?package(xtrkcad):\ needs="x11" \ section="Applications/Editors" \ command="/usr/bin/xtrkcad" \ title="Xtrkcad" \ longtitle="Xtrkcad: Model Train Track Layout Program" debian/xtrkcad.10000644000000000000000000000141511426522651010715 0ustar .TH XTRKCAD 1 .SH NAME xtrkcad \- model railroad track CAD program .SH "DESCRIPTION" This manual page documents briefly the .BR xtrkcad command. This manual page was written for the Debian GNU/Linux distribution (but may be used by others), because the original program did not have a manual page. .PP .B xtrkcad is a program that can be used to design a model railroad layout. .PP For more information on .B xtrkcad, go read the online documentation under /usr/share/doc/xtrkcad. .SH LICENSE The .B xtrkcad program was originally a product of Sillub. See www.sillub.com for more information. It is now maintained by a community effort on SourceForge. .SH AUTHOR This (incredibly lame) manual page was written by Bdale Garbee , for the Debian GNU/Linux system. debian/patches/0000755000000000000000000000000011426627732010627 5ustar debian/patches/libwebkit-help.patch0000644000000000000000000005306211426532220014543 0ustar Source changes converting gtk help dialog from libgtkhtml to libwebkit. --- a/app/wlib/gtklib/gtkhelp.c +++ b/app/wlib/gtklib/gtkhelp.c @@ -36,7 +36,7 @@ #include #include -#include +#include #include "gtkint.h" @@ -59,12 +59,16 @@ #define BACKBUTTON "back" #define FORWARDBUTTON "forward" +#define HOMEBUTTON "home" +#define CONTENTBUTTON "contents" #define TOCDOC "tocDoc" #define CONTENTSDOC "contentsDoc" #define TOCVIEW "viewLeft" #define CONTENTSVIEW "viewRight" #define PANED "hpane" +enum pane_views { MAIN_VIEW, CONTENTS_VIEW }; + #define MAXHISTORYSIZE 20 /** \struct htmlHistory @@ -86,6 +90,8 @@ static char *directory; /**< base directory for HTML files */ static GtkWidget *wHelpWindow; /**< handle for the help window */ +static GtkWidget *main_view; /** handle for the help main data pane */ +static GtkWidget *contents_view; /** handle for the help contents pane */ #define GLADE_HOOKUP_OBJECT(component,widget,name) \ g_object_set_data_full (G_OBJECT (component), name, \ @@ -424,343 +430,6 @@ return( hpaned ); } -/** - * load a HTML file into the specified doc.The base directory will be prepended before - * the file is opmned for reading. In case the file can't be opened, a static error - * page is output to teh document. - * - * \PARAM view IN HTML view to display in - * \PARAM doc IN document into which the file will be loaded. - * \PARAM file IN filename to load. - */ - -static void -LoadHtml( GtkWidget *view, HtmlDocument *doc, const char *file ) -{ - char *filename; - char *copyOfUrl; - char *htmlFile; - char *buffer; - int handle; - int len; - - /* create a working copy of the filename, as this will be modified */ - copyOfUrl = strdup( file ); - assert( copyOfUrl != NULL ); - - /* separate an anchor from the rest */ - filename = strtok( copyOfUrl, "#" ); - - /* make sure that the filename as a file part and is not only an anchor */ - if( file[ 0 ] != '#' ) { - html_view_set_document( HTML_VIEW(view), NULL ); - - /* assemble the full filename for the HTML file */ - htmlFile = malloc( strlen( directory ) + strlen( filename ) + 1 ); - assert( htmlFile != NULL ); - - strcpy( htmlFile, directory ); - strcat( htmlFile, filename ); - - /* open the output stream */ - html_document_open_stream (doc, "text/html"); - - /* open the file */ - handle = open( htmlFile, O_RDONLY ); - if( handle != -1 ) - { - /* if successful, read the file and output it to the document */ - buffer = malloc( 8192 ); - assert( buffer != NULL ); - - while((len = read( handle, buffer, 8192 )) > 0 ) { - html_document_write_stream( doc, buffer, len ); - } - - /* clean up */ - free( buffer ); - close( handle ); - - } else { - /* file could not be opened, display the error page instead */ - html_document_write_stream( doc, HTMLERRORTEXT, strlen( HTMLERRORTEXT )); - - } - - - html_view_set_document(HTML_VIEW( view ), doc); - - /* clean up */ - html_document_close_stream (doc); - free( htmlFile ); - - filename = strtok( NULL, "#" ); - } - - if( filename ) { - /* jump to anchor */ - html_view_jump_to_anchor( HTML_VIEW(view), filename ); - } - - free( copyOfUrl ); - - -} - -/** - * handles clicks on the forward / backward buttons. - * - * \PARAM widget IN button pressed - * \PARAM data IN dialog window handle - */ - -static void -DoHistory( GtkWidget *widget, void *data ) -{ - GtkWidget *parent = (GtkWidget *)data; - GtkWidget *back = lookup_widget( parent, BACKBUTTON ); - GtkWidget *forw = lookup_widget( parent, FORWARDBUTTON); - HtmlDocument *doc = (HtmlDocument *)lookup_widget( parent, CONTENTSDOC ); - GtkWidget *view = lookup_widget( parent, CONTENTSVIEW ); - - if( widget == back ) { - sHtmlHistory.curShownPage = DECBUFFERINDEX( sHtmlHistory.curShownPage ); - - /* enable forward button */ - gtk_widget_set_sensitive( forw, TRUE ); - - /* if oldest page is shown, disable back button */ - if( sHtmlHistory.curShownPage == sHtmlHistory.oldestPage ) - gtk_widget_set_sensitive( widget, FALSE ); - } else { - if( widget == forw ) { - sHtmlHistory.curShownPage = INCBUFFERINDEX( sHtmlHistory.curShownPage ); - - /* enable back button */ - gtk_widget_set_sensitive( back, TRUE ); - /* if newest page is shown, disable forward button */ - if( sHtmlHistory.curShownPage == sHtmlHistory.newestPage ) - gtk_widget_set_sensitive( widget, FALSE ); - } else { - assert(( widget == forw || widget == back )); - } - } - - LoadHtml( view, doc, sHtmlHistory.url[ sHtmlHistory.curShownPage ]); -} - - -/** - * Put the filename into the history stack. - * - * \PARAM helpWin IN handle of help window - * \PARAM filename IN relative filename to put onto the stack - */ - -static void -AddToHistory( GtkWidget *helpWin, char *filename ) -{ - /* this handles the start case when the buffer is still empty */ - if( sHtmlHistory.bInUse ) - { - /* starting from the second page added, curShownPage is always advanced */ - sHtmlHistory.curShownPage = INCBUFFERINDEX( sHtmlHistory.curShownPage ); - gtk_widget_set_sensitive( lookup_widget( helpWin, BACKBUTTON ), TRUE ); - } - - gtk_widget_set_sensitive( lookup_widget( helpWin, FORWARDBUTTON ), FALSE ); - - - sHtmlHistory.newestPage = sHtmlHistory.curShownPage; - - if( sHtmlHistory.url[ sHtmlHistory.newestPage ] ) - free( sHtmlHistory.url[ sHtmlHistory.newestPage ] ); - - /* put the filaname into the buffer */ - sHtmlHistory.url[ sHtmlHistory.newestPage ] = strdup( filename ); - - if( sHtmlHistory.newestPage == sHtmlHistory.oldestPage && sHtmlHistory.bInUse ) - /* the buffer pointer wrapped around, so the oldest entry will be overwritten next. - The relevant index now points to the second oldest entry */ - sHtmlHistory.oldestPage = INCBUFFERINDEX( sHtmlHistory.oldestPage ); - - sHtmlHistory.bInUse = TRUE; - - return; -} - -/** - * handles the clicked event for the Home button. Single action is to load - * the homepage into the contents window. - * \PARAM widget IN ignored - * \PARAM data IN handle for the help dialog window - * - */ - -static void -LoadHomepage( GtkWidget *widget, void *data ) -{ - GtkWidget *parent = (GtkWidget *)data; - HtmlDocument *doc = (HtmlDocument *)lookup_widget( parent, CONTENTSDOC ); - GtkWidget *view = lookup_widget( parent, CONTENTSVIEW ); - - - AddToHistory( (GtkWidget *)data, "index.html" ); - - LoadHtml( view, doc, "index.html" ); -} - -/** - * Create all the widgets for decorating and scrolling an HTML view - * - * \PARAM paned IN the pane container holding the view - * \PARAM PackFunc IN pointer to function for adding the widget to the pane - * \PARAM htmlView IN the HTML view widget to add - * - * \RETURN the scroll widget - */ - -static GtkWidget* -CreateHtmlViewScrollable( GtkWidget *paned, void PackFunc( GtkPaned *, GtkWidget *), GtkWidget *htmlView ) -{ - GtkWidget *frame; - GtkWidget *scroll; - - /* a frame */ - frame = gtk_frame_new( NULL ); - PackFunc( (GtkPaned *)paned, frame ); - - /* and a scroll window holding the HTML view */ - scroll = gtk_scrolled_window_new( NULL, NULL ); - gtk_scrolled_window_set_policy( GTK_SCROLLED_WINDOW(scroll), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC ); - gtk_container_add( GTK_CONTAINER( scroll ), htmlView ); - - /* put the scroll window into the frame */ - gtk_container_add( GTK_CONTAINER(frame), GTK_WIDGET(scroll)); - - return scroll; -} - -/** - * Create a new stock button. The button is created, made visible, disabled and stuffed into a container. - * Additionally a click handler is registered. - * - * \PARAM name IN Stock name of the button - * \PARAM container IN Container into which the button is stuffed - * \PARAM clickHandler IN handler to be called on button click - * \PARAM userData IN data to be passed to this handler - * - * \RETURN button handle - */ - -static GtkWidget * -CreateButton( char *name, GtkWidget *container, GCallback clickHandler, void *userData ) -{ - GtkWidget *button; - - button = gtk_button_new_from_stock( name ); - gtk_widget_set_sensitive( button, FALSE ); - gtk_widget_show( button ); - gtk_container_add( GTK_CONTAINER( container ), button ); - GTK_WIDGET_SET_FLAGS(button, GTK_CAN_DEFAULT); - - g_signal_connect( button, "clicked", clickHandler, userData ); - - return( button ); -} - -/** - * Create a HTML document object. - * - * \PARAM UrlReq IN callback for requesting URLs - * \PARAM LinkClick IN callback for 'link clicked' events - * \PARAM userData IN additional data to be passed with events - * - * \RETURN doc created document object - */ - -static HtmlDocument * -CreateHtmlDoc( GCallback UrlReq, GCallback LinkClick, void *userData ) -{ - HtmlDocument *doc; - - doc = html_document_new(); - - g_signal_connect (G_OBJECT( doc ), "request_url", UrlReq, userData ); - - /* whenever the user selects a link here, the contents area has to be updated */ - g_signal_connect(G_OBJECT (doc), "link_clicked", LinkClick, userData); - - return doc; -} - -/** - * Event handler for clicks onto links. - * - * \PARAM doc IN affected HTML document - * \PARAM uri IN selected resource - * \PARAM ptr IN pointer to user data ( help window handle ) - */ - -void -LinkClicked(HtmlDocument *doc, const gchar *uri, void *ptr ) -{ - GtkWidget *outView = lookup_widget( ptr, CONTENTSVIEW); - HtmlDocument *docCont = (HtmlDocument *)lookup_widget( ptr, CONTENTSDOC ); - - AddToHistory((GtkWidget *)ptr, (char *)uri ); - - LoadHtml( outView, docCont, uri ); - - return; -} - -/** - * Event handler for URL requests. This handler is called for all inline URLs eg. images. - * The files are read and the contents is dumped into the supplied stream. - * - * \PARAM doc IN affected HTML document - * \PARAM uri IN requested url - * \PARAM stream IN stream into which the data should be written - * \PARAM data IN unused - */ - - -void -UrlRequested(HtmlDocument *doc, const gchar *uri, HtmlStream *stream, gpointer data) -{ - char *filename; - char *buffer; - int handle; - int len; - - filename = malloc( strlen( directory ) + strlen( uri ) + 1 ); - assert( filename != NULL ); - - strcpy( filename, directory ); - strcat( filename, uri ); - - handle = open( filename, O_RDONLY ); - if( handle ) - { - buffer = malloc( 8192 ); - assert( buffer != NULL ); - - while((len = read( handle, buffer, 8192 )) > 0 ) { - html_stream_write( stream, buffer, len ); - } - close( handle ); - - free( buffer ); - } - - free( filename ); - - html_stream_close(stream); - - return; -} - /** * Handler for the delete-event issued on the help window.We are saving window * information (eg. position) and are hiding the window instead of closing it. @@ -800,6 +469,81 @@ return TRUE; } +void back_button_clicked(GtkWidget *widget, gpointer data) { + webkit_web_view_go_back(WEBKIT_WEB_VIEW(data)); +} + +void forward_button_clicked(GtkWidget *widget, gpointer data) { + webkit_web_view_go_forward(WEBKIT_WEB_VIEW(data)); +} + +void home_button_clicked(GtkWidget *widget, gpointer data) { + load_into_view("index.html", MAIN_VIEW); +} + +/* Toggles the contents pane */ +void contents_button_clicked(GtkWidget *widget, gpointer data) { + if (gtk_paned_get_position(GTK_PANED(data)) < 50) { + gtk_paned_set_position(GTK_PANED(data), 370); + } + else { + gtk_paned_set_position(GTK_PANED(data), 0); + } +} + +gboolean contents_click_handler( + WebKitWebView *web_view, + WebKitWebFrame *frame, + WebKitNetworkRequest *request, + WebKitWebNavigationAction *navigation_action, + WebKitWebPolicyDecision *policy_decision, + gpointer data) { + + webkit_web_view_load_uri(WEBKIT_WEB_VIEW(data), webkit_network_request_get_uri(request)); + + return TRUE; +} + +/** + * Initialize the buttons for the help window + */ +void initialize_buttons (GtkWidget *main_vbox, GtkWidget *content_hpane) { + GtkWidget *buttons_hbuttonbox; + GtkWidget *back_button; + GtkWidget *forward_button; + GtkWidget *home_button; + GtkWidget *contents_button; + + // define and attach signals to buttons + back_button = gtk_button_new_with_label("Back"); + g_signal_connect(back_button, "clicked", G_CALLBACK(back_button_clicked), G_OBJECT(main_view)); + + forward_button = gtk_button_new_with_label("Forward"); + g_signal_connect(forward_button, "clicked", G_CALLBACK(forward_button_clicked), G_OBJECT(main_view)); + + home_button = gtk_button_new_with_label("Home"); + g_signal_connect(home_button, "clicked", G_CALLBACK(home_button_clicked), G_OBJECT(main_view)); + + contents_button = gtk_button_new_with_label("Contents"); + g_signal_connect(contents_button, "clicked", G_CALLBACK(contents_button_clicked), G_OBJECT(content_hpane)); + + // button layout + buttons_hbuttonbox = gtk_hbutton_box_new(); + gtk_container_add(GTK_CONTAINER(buttons_hbuttonbox), back_button); + gtk_container_add(GTK_CONTAINER(buttons_hbuttonbox), forward_button); + gtk_container_add(GTK_CONTAINER(buttons_hbuttonbox), home_button); + gtk_container_add(GTK_CONTAINER(buttons_hbuttonbox), contents_button); + gtk_box_pack_start(GTK_BOX(main_vbox), buttons_hbuttonbox, FALSE, TRUE, 0); + gtk_box_set_spacing(GTK_BOX(buttons_hbuttonbox), 6); + gtk_button_box_set_layout(GTK_BUTTON_BOX(buttons_hbuttonbox), GTK_BUTTONBOX_START); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT (main_view, back_button, BACKBUTTON); + GLADE_HOOKUP_OBJECT (main_view, forward_button, FORWARDBUTTON); + GLADE_HOOKUP_OBJECT (main_view, home_button, HOMEBUTTON); + GLADE_HOOKUP_OBJECT (main_view, contents_button, CONTENTBUTTON); +} + /** * Create the help windows including all contained widgets and the needed HTML documents. * @@ -809,20 +553,10 @@ GtkWidget* CreateHelpWindow (void) { - GtkWidget *wHelpWindow; - GtkWidget *vbox2; - GtkWidget *hbuttonbox1; - GtkWidget *back; - GtkWidget *forw; - GtkWidget *button3; - GtkWidget *hbox1; - GtkWidget *image2; - GtkWidget *label18; - GtkWidget *hpaned; - GtkWidget *viewLeft; - GtkWidget *viewRight; - HtmlDocument *doc1; - HtmlDocument *doc2; + GtkWidget *main_vbox; + GtkWidget *main_view_scroller; + GtkWidget *contents_view_scroller; + GtkWidget *content_hpane; int width; int height; @@ -830,7 +564,7 @@ int w = 0, h = 0; const char *pref; - wHelpWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); + wHelpWindow = gtk_window_new (GTK_WINDOW_TOPLEVEL); width = gdk_screen_get_width( gtk_window_get_screen( (GtkWindow *)wHelpWindow )); height = gdk_screen_get_height( gtk_window_get_screen( (GtkWindow *)wHelpWindow )); @@ -861,91 +595,69 @@ x = ( width * 3 ) / 5 - 10; y = 70; } - gtk_window_resize( (GtkWindow *)wHelpWindow, w, h ); gtk_window_move( (GtkWindow *)wHelpWindow, x, y ); - gtk_window_set_title (GTK_WINDOW (wHelpWindow), "XTrkCad Help"); + gtk_window_set_title (GTK_WINDOW (wHelpWindow), "XTrkCad Help"); g_signal_connect( G_OBJECT( wHelpWindow ), "delete-event", G_CALLBACK( DestroyHelpWindow ), NULL ); - vbox2 = gtk_vbox_new (FALSE, 0); - gtk_widget_show (vbox2); - - gtk_container_add (GTK_CONTAINER (wHelpWindow), vbox2); - - hbuttonbox1 = gtk_hbutton_box_new (); - gtk_widget_show (hbuttonbox1); - gtk_box_pack_start (GTK_BOX (vbox2), hbuttonbox1, FALSE, TRUE, 0); - gtk_button_box_set_layout (GTK_BUTTON_BOX (hbuttonbox1), GTK_BUTTONBOX_START); - gtk_container_set_border_width (GTK_CONTAINER (hbuttonbox1), 6); - gtk_box_set_spacing (GTK_BOX (hbuttonbox1), 6); - - - /* the two navigation buttons */ - back = CreateButton( "gtk-go-back", hbuttonbox1, (GCallback)DoHistory, wHelpWindow ); - - forw = CreateButton( "gtk-go-forward", hbuttonbox1, (GCallback)DoHistory, wHelpWindow ); + main_view_scroller = gtk_scrolled_window_new(NULL, NULL); + contents_view_scroller = gtk_scrolled_window_new(NULL, NULL); + main_view = webkit_web_view_new(); + contents_view = webkit_web_view_new(); + // must be done here as it gets locked down later + load_into_view ("contents.html", CONTENTS_VIEW); + gtk_widget_set_size_request(GTK_WIDGET(wHelpWindow), x, y); + + main_vbox = gtk_vbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(wHelpWindow), main_vbox); + + gtk_container_add(GTK_CONTAINER(main_view_scroller), main_view); + + gtk_container_add(GTK_CONTAINER(contents_view_scroller), contents_view); + + content_hpane = gtk_hpaned_new(); + initialize_buttons(main_vbox, content_hpane); + gtk_container_add(GTK_CONTAINER(content_hpane), contents_view_scroller); + gtk_container_add(GTK_CONTAINER(content_hpane), main_view_scroller); + gtk_box_pack_start(GTK_BOX(main_vbox), content_hpane, TRUE, TRUE, 0); - /* as we want to set the text shown, the GTK_STOCK_HOME can't be used here */ - button3 = gtk_button_new (); - gtk_widget_show (button3); - gtk_container_add (GTK_CONTAINER (hbuttonbox1), button3); - GTK_WIDGET_SET_FLAGS (button3, GTK_CAN_DEFAULT); + gtk_paned_set_position(GTK_PANED(content_hpane), 370); - hbox1 = gtk_hbox_new (FALSE, 0); - gtk_widget_show (hbox1); - gtk_container_add (GTK_CONTAINER (button3), hbox1); - - image2 = gtk_image_new_from_stock ("gtk-home", GTK_ICON_SIZE_BUTTON); - gtk_widget_show (image2); - gtk_box_pack_start (GTK_BOX (hbox1), image2, TRUE, FALSE, 0); - gtk_misc_set_alignment (GTK_MISC (image2), 0, 0); - - label18 = gtk_label_new ("Home"); - gtk_widget_show (label18); - gtk_box_pack_end (GTK_BOX (hbox1), label18, TRUE, TRUE, 0); - gtk_misc_set_alignment (GTK_MISC (label18), 0, 0.5); - - g_signal_connect( GTK_WIDGET( button3 ), "clicked", (GCallback)LoadHomepage, wHelpWindow ); - - /* - * create the browser windows - */ - - /* the horizontal slider */ - hpaned = CreateHPaned( GTK_BOX (vbox2), "property" ); - - /* the left side of the slider */ - viewLeft = html_view_new (); - html_view_set_magnification (HTML_VIEW (viewLeft), 1 ); + g_signal_connect(contents_view, "navigation-policy-decision-requested", G_CALLBACK(contents_click_handler), G_OBJECT(main_view)); + + /* Store pointers to all widgets, for use by lookup_widget(). */ + GLADE_HOOKUP_OBJECT_NO_REF (wHelpWindow, wHelpWindow, "wHelpWindow"); + GLADE_HOOKUP_OBJECT (wHelpWindow, content_hpane, PANED ); + GLADE_HOOKUP_OBJECT (wHelpWindow, contents_view, TOCVIEW ); + GLADE_HOOKUP_OBJECT (wHelpWindow, main_view, CONTENTSVIEW ); - CreateHtmlViewScrollable( hpaned, gtk_paned_add1, viewLeft ); + return wHelpWindow; +} - doc1 = CreateHtmlDoc( (GCallback)UrlRequested, (GCallback)LinkClicked, wHelpWindow ); - - /* the right side of the slider */ - viewRight = html_view_new (); - html_view_set_magnification (HTML_VIEW (viewRight), 1 ); +void load_into_view (char *file, int requested_view) { + GtkWidget *view; - CreateHtmlViewScrollable( hpaned, gtk_paned_add2, viewRight ); + switch (requested_view) { + case MAIN_VIEW: + view = main_view; + break; + case CONTENTS_VIEW: + view = contents_view; + break; + default: + printf("*** error, could not find view"); + break; + } - doc2 = CreateHtmlDoc( (GCallback)UrlRequested, (GCallback)LinkClicked, wHelpWindow ); - - /* Store pointers to all widgets, for use by lookup_widget(). */ - GLADE_HOOKUP_OBJECT_NO_REF (wHelpWindow, wHelpWindow, "wHelpWindow"); - GLADE_HOOKUP_OBJECT (wHelpWindow, back, BACKBUTTON); - GLADE_HOOKUP_OBJECT (wHelpWindow, forw, FORWARDBUTTON); - GLADE_HOOKUP_OBJECT (wHelpWindow, button3, "button3"); - GLADE_HOOKUP_OBJECT (wHelpWindow, hpaned, PANED ); - GLADE_HOOKUP_OBJECT (wHelpWindow, viewLeft, TOCVIEW ); - GLADE_HOOKUP_OBJECT (wHelpWindow, viewRight, CONTENTSVIEW ); - GLADE_HOOKUP_OBJECT_NO_REF (wHelpWindow, (GtkWidget *)doc1, TOCDOC ); - GLADE_HOOKUP_OBJECT_NO_REF (wHelpWindow, (GtkWidget *)doc2, CONTENTSDOC ); - + char fileToLoad[100] = "file://"; + strcat(fileToLoad,directory); + strcat(fileToLoad,file); - return wHelpWindow; + //debug printf("*** loading %s into pane %d.\n", fileToLoad, requested_view); + webkit_web_view_load_uri(WEBKIT_WEB_VIEW(view), fileToLoad); } /** @@ -956,43 +668,30 @@ EXPORT void wHelp( const char * topic ) { - HtmlDocument *docToc; - HtmlDocument *docContents; - GtkWidget *view; - GtkWidget *viewToc; char *htmlFile; - if( !wHelpWindow ) { - wHelpWindow = CreateHelpWindow(); directory = malloc( BUFSIZ ); assert( directory != NULL ); sprintf( directory, "%s/html/", wGetAppLibDir()); - /* initialize the left pane of the window */ - viewToc = lookup_widget( wHelpWindow, TOCVIEW); - docToc = (HtmlDocument *)lookup_widget( wHelpWindow, TOCDOC ); + wHelpWindow = CreateHelpWindow(); - /* load and show the table of contents */ - LoadHtml( viewToc, docToc, "contents.html" ); + /* load the default content */ + load_into_view ("index.html", MAIN_VIEW); } - /* display the requested page in the main pane */ - view = lookup_widget( wHelpWindow, CONTENTSVIEW); - docContents = (HtmlDocument *)lookup_widget( wHelpWindow, CONTENTSDOC ); - /* need space for the 'html' extension plus dot plus \0 */ htmlFile = malloc( strlen( topic ) + 6 ); assert( htmlFile != NULL ); sprintf( htmlFile, "%s.html", topic ); - AddToHistory( wHelpWindow, htmlFile ); - LoadHtml( view, docContents, htmlFile ); + load_into_view (htmlFile, MAIN_VIEW); - gtk_widget_show_all (wHelpWindow); + gtk_widget_show_all (wHelpWindow); gtk_window_present( wHelpWindow ); } debian/patches/series0000644000000000000000000000011011426540442012024 0ustar libwebkit-makefiles.patch libwebkit-help.patch debian-changes-1:4.0.2-2 debian/patches/libwebkit-makefiles.patch0000644000000000000000000000304511426540375015561 0ustar Makefile and CMakelist changes converting the package build from libgtkhtml to libwebkit. --- a/app/CMakeLists.txt +++ b/app/CMakeLists.txt @@ -6,7 +6,7 @@ IF(NOT WIN32) INCLUDE(FindPkgConfig) PKG_CHECK_MODULES(GTK "gtk+-2.0") - PKG_CHECK_MODULES(GTKHTML "libgtkhtml-2.0") + PKG_CHECK_MODULES(GTK_WEBKIT "webkit-1.0") ENDIF(NOT WIN32) ADD_SUBDIRECTORY(tools) --- a/app/bin/Makefile +++ b/app/bin/Makefile @@ -83,7 +83,7 @@ WLIBS = $(WLIB)/gtklib/gtk2lib$(VER).a #GTKLIBS = -lgtk-x11-2.0 -lgdk-x11-2.0 -lglib-2.0 -lpango-1.0 -GTKLIBS = `pkg-config --libs libgtkhtml-2.0` +GTKLIBS = `pkg-config --libs webkit-1.0` XLIBS = -L/usr/X11R6/lib -lX11 LIBS = $(WLIBS) $(GTKLIBS) $(XLIBS) -lm --- a/app/wlib/gtklib/CMakeLists.txt +++ b/app/wlib/gtklib/CMakeLists.txt @@ -4,7 +4,7 @@ SET_SOURCE_FILES_PROPERTIES(wpref.c PROPERTIES COMPILE_FLAGS -DEXPORT=) INCLUDE_DIRECTORIES(${GTK_INCLUDE_DIRS}) -INCLUDE_DIRECTORIES(${GTKHTML_INCLUDE_DIRS}) +INCLUDE_DIRECTORIES(${GTK_WEBKIT_INCLUDE_DIRS}) ADD_LIBRARY(xtrackcad-wlib SHARED ${HEADERS} ${SOURCES}) --- a/app/wlib/gtklib/Makefile +++ b/app/wlib/gtklib/Makefile @@ -2,7 +2,7 @@ # $Header: /cvsroot/xtrkcad-fork/xtrkcad/app/wlib/gtklib/Makefile,v 1.7 2007/11/12 18:53:15 m_fischer Exp $ # -GTKINCL=`pkg-config --cflags libgtkhtml-2.0` +GTKINCL=`pkg-config --cflags webkit-1.0` COPTS = -Wall CINCLS = -I../include $(GTKINCL) @@ -29,7 +29,7 @@ wpref.o \ psprint.o -LIBS = `pkg-config --libs libgtkhtml-2.0` +LIBS = `pkg-config --libs webkit-1.0` CSRCS = $(OBJS:.o=.c) HDRS = gtkint.h dynarr.h debian/patches/debian-changes-1:4.0.2-20000644000000000000000000002104211426627732014352 0ustar Description: Upstream changes introduced in version 1:4.0.2-2 This patch has been created by dpkg-source during the package build. Here's the last changelog entry, hopefully it gives details on why those changes were made: . xtrkcad (1:4.0.2-2) unstable; urgency=low . * new maintainer, closes: #383968 * switched help system to libwebkit, closes: #549039 . The person named in the Author field signed this changelog entry. Author: Daniel E. Markle Bug-Debian: http://bugs.debian.org/383968 Bug-Debian: http://bugs.debian.org/549039 --- The information above should follow the Patch Tagging Guidelines, please checkout http://dep.debian.net/deps/dep3/ to learn about the format. Here are templates for supplementary fields that you might want to add: Origin: , Bug: Bug-Debian: http://bugs.debian.org/ Bug-Ubuntu: https://launchpad.net/bugs/ Forwarded: Reviewed-By: Last-Update: --- xtrkcad-4.0.2.orig/app/tools/Makefile +++ xtrkcad-4.0.2/app/tools/Makefile @@ -1,8 +1,9 @@ # CMAKE generated file: DO NOT EDIT! -# Generated by "Unix Makefiles" Generator, CMake Version 2.4 +# Generated by "Unix Makefiles" Generator, CMake Version 2.8 # Default target executed when no arguments are given to make. default_target: all +.PHONY : default_target #============================================================================= # Special targets provided by cmake. @@ -10,6 +11,9 @@ default_target: all # Disable implicit rules so canoncical targets will work. .SUFFIXES: +# Remove some rules from gmake that .SUFFIXES does not remove. +SUFFIXES = + .SUFFIXES: .hpux_make_needs_suffix_list # Suppress display of executed commands. @@ -17,6 +21,7 @@ $(VERBOSE).SILENT: # A target that is always out of date. cmake_force: +.PHONY : cmake_force #============================================================================= # Set environment variables for the build. @@ -25,66 +30,70 @@ cmake_force: SHELL = /bin/sh # The CMake executable. -CMAKE_COMMAND = /usr/local/bin/cmake +CMAKE_COMMAND = /usr/bin/cmake # The command to remove a file. -RM = /usr/local/bin/cmake -E remove -f - -# The program to use to edit the cache. -CMAKE_EDIT_COMMAND = /usr/local/bin/ccmake +RM = /usr/bin/cmake -E remove -f # The top-level source directory on which CMake was run. -CMAKE_SOURCE_DIR = /home/martin/xtc/xtrkcad/app/tools +CMAKE_SOURCE_DIR = /home/dmarkle/debian/xtrkcad-4.0.2/app/tools # The top-level build directory on which CMake was run. -CMAKE_BINARY_DIR = /home/martin/xtc/xtrkcad/app/tools - -# Include the progress variables for this target. -include CMakeFiles/progress.make +CMAKE_BINARY_DIR = /home/dmarkle/debian/xtrkcad-4.0.2/app/tools #============================================================================= # Targets provided globally by CMake. # Special rule for the target edit_cache edit_cache: - @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake cache editor..." - /usr/local/bin/ccmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) + @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running interactive CMake command-line interface..." + /usr/bin/cmake -i . +.PHONY : edit_cache # Special rule for the target edit_cache edit_cache/fast: edit_cache +.PHONY : edit_cache/fast # Special rule for the target rebuild_cache rebuild_cache: @$(CMAKE_COMMAND) -E cmake_echo_color --switch=$(COLOR) --cyan "Running CMake to regenerate build system..." - /usr/local/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) + /usr/bin/cmake -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) +.PHONY : rebuild_cache # Special rule for the target rebuild_cache rebuild_cache/fast: rebuild_cache +.PHONY : rebuild_cache/fast # The main all target all: cmake_check_build_system - $(CMAKE_COMMAND) -E cmake_progress_start /home/martin/xtc/xtrkcad/app/tools/CMakeFiles $(CMAKE_ALL_PROGRESS) + $(CMAKE_COMMAND) -E cmake_progress_start /home/dmarkle/debian/xtrkcad-4.0.2/app/tools/CMakeFiles /home/dmarkle/debian/xtrkcad-4.0.2/app/tools/CMakeFiles/progress.marks $(MAKE) -f CMakeFiles/Makefile2 all - $(CMAKE_COMMAND) -E cmake_progress_start /home/martin/xtc/xtrkcad/app/tools/CMakeFiles 0 + $(CMAKE_COMMAND) -E cmake_progress_start /home/dmarkle/debian/xtrkcad-4.0.2/app/tools/CMakeFiles 0 +.PHONY : all # The main clean target clean: $(MAKE) -f CMakeFiles/Makefile2 clean +.PHONY : clean # The main clean target clean/fast: clean +.PHONY : clean/fast # Prepare targets for installation. preinstall: all $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall # Prepare targets for installation. preinstall/fast: $(MAKE) -f CMakeFiles/Makefile2 preinstall +.PHONY : preinstall/fast # clear depends depend: $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 1 +.PHONY : depend #============================================================================= # Target rules for targets named addcrlf @@ -92,10 +101,12 @@ depend: # Build rule for target. addcrlf: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 addcrlf +.PHONY : addcrlf # fast build rule for target. addcrlf/fast: $(MAKE) -f CMakeFiles/addcrlf.dir/build.make CMakeFiles/addcrlf.dir/build +.PHONY : addcrlf/fast #============================================================================= # Target rules for targets named bin2c @@ -103,10 +114,12 @@ addcrlf/fast: # Build rule for target. bin2c: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 bin2c +.PHONY : bin2c # fast build rule for target. bin2c/fast: $(MAKE) -f CMakeFiles/bin2c.dir/build.make CMakeFiles/bin2c.dir/build +.PHONY : bin2c/fast #============================================================================= # Target rules for targets named halibut @@ -114,10 +127,12 @@ bin2c/fast: # Build rule for target. halibut: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 halibut +.PHONY : halibut # fast build rule for target. halibut/fast: $(MAKE) -f halibut/CMakeFiles/halibut.dir/build.make halibut/CMakeFiles/halibut.dir/build +.PHONY : halibut/fast #============================================================================= # Target rules for targets named charset @@ -125,37 +140,45 @@ halibut/fast: # Build rule for target. charset: cmake_check_build_system $(MAKE) -f CMakeFiles/Makefile2 charset +.PHONY : charset # fast build rule for target. charset/fast: $(MAKE) -f halibut/charset/CMakeFiles/charset.dir/build.make halibut/charset/CMakeFiles/charset.dir/build +.PHONY : charset/fast # target to build an object file addcrlf.o: $(MAKE) -f CMakeFiles/addcrlf.dir/build.make CMakeFiles/addcrlf.dir/addcrlf.o +.PHONY : addcrlf.o # target to preprocess a source file addcrlf.i: $(MAKE) -f CMakeFiles/addcrlf.dir/build.make CMakeFiles/addcrlf.dir/addcrlf.i +.PHONY : addcrlf.i # target to generate assembly for a file addcrlf.s: $(MAKE) -f CMakeFiles/addcrlf.dir/build.make CMakeFiles/addcrlf.dir/addcrlf.s +.PHONY : addcrlf.s # target to build an object file bin2c.o: $(MAKE) -f CMakeFiles/bin2c.dir/build.make CMakeFiles/bin2c.dir/bin2c.o +.PHONY : bin2c.o # target to preprocess a source file bin2c.i: $(MAKE) -f CMakeFiles/bin2c.dir/build.make CMakeFiles/bin2c.dir/bin2c.i +.PHONY : bin2c.i # target to generate assembly for a file bin2c.s: $(MAKE) -f CMakeFiles/bin2c.dir/build.make CMakeFiles/bin2c.dir/bin2c.s +.PHONY : bin2c.s # Help Target -help:: +help: @echo "The following are some of the valid targets for this Makefile:" @echo "... all (the default if no target is provided)" @echo "... clean" @@ -164,19 +187,7 @@ help:: @echo "... bin2c" @echo "... edit_cache" @echo "... rebuild_cache" - @echo "... addcrlf.o" - @echo "... addcrlf.i" - @echo "... addcrlf.s" - @echo "... bin2c.o" - @echo "... bin2c.i" - @echo "... bin2c.s" @echo "... halibut" - @echo "... addcrlf.o" - @echo "... addcrlf.i" - @echo "... addcrlf.s" - @echo "... bin2c.o" - @echo "... bin2c.i" - @echo "... bin2c.s" @echo "... charset" @echo "... addcrlf.o" @echo "... addcrlf.i" @@ -184,6 +195,7 @@ help:: @echo "... bin2c.o" @echo "... bin2c.i" @echo "... bin2c.s" +.PHONY : help @@ -195,4 +207,5 @@ help:: # because they might be regenerated. cmake_check_build_system: $(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0 +.PHONY : cmake_check_build_system debian/README.Debian0000644000000000000000000000033211426522651011231 0ustar If you get errors when bringing up help dialogs about a buffer overflowing, they can be fixed by adding the following to your .Xresources file and merging the resource with xrdb: Text.MaxDocumentSize: 65536 Bdale debian/dirs0000644000000000000000000000006011426522651010052 0ustar usr/bin usr/lib/xtrkcad usr/share/xtrkcad/html debian/changelog0000644000000000000000000001120411515532575011047 0ustar xtrkcad (1:4.0.2-2ubuntu1) natty; urgency=low * Change build-depends from libwebkit-dev to libwebkitgtk-dev as a part of webkit transition. - update debian/control -- Bhavani Shankar Wed, 19 Jan 2011 15:24:54 +0530 xtrkcad (1:4.0.2-2) unstable; urgency=low * new maintainer, closes: #383968 * switched help system to libwebkit, closes: #549039 -- Daniel E. Markle Fri, 25 Jun 2010 07:59:01 -0400 xtrkcad (1:4.0.2-1.1) unstable; urgency=low * Non-maintainer upload. * chmod +x sbcsgen.pl script used in building (Closes: 482257) - required by newer versions of cmake -- Mike O'Connor Tue, 03 Jun 2008 21:54:51 -0400 xtrkcad (1:4.0.2-1) unstable; urgency=low * new uptream version, closes: #458077 * fix path to docs in man page, closes: #458319 -- Bdale Garbee Tue, 15 Apr 2008 22:50:44 -0600 xtrkcad (1:4.0.1-1) unstable; urgency=low * new upstream version * building twice in a row appears to work now, closes: #424098 * don't strip in bin/Makefile, closes: #438353 -- Bdale Garbee Wed, 05 Sep 2007 13:43:47 +0100 xtrkcad (20061215-1) unstable; urgency=low * freshen from upstream CVS (just one minor variable initialization patch) -- Bdale Garbee Fri, 15 Dec 2006 09:54:11 -0700 xtrkcad (20060529-2) unstable; urgency=low * add build dependency on imagemagick, closes: #374639 -- Bdale Garbee Tue, 20 Jun 2006 11:31:30 -0600 xtrkcad (20060529-1) unstable; urgency=low * new upstream version * move from xtrkcad (dormant) to xtrkcad-fork on advice from Alistair Baty * update control file to reflect this is no longer feature-reduced -- Bdale Garbee Mon, 29 May 2006 22:45:15 -0600 xtrkcad (20060415-1) unstable; urgency=low * xtrkcad is now GPL'ed, so it can move to main! closes: #318369 * building a CVS snapshot from sourceforge * fix priority to match override file * should build anywhere, so change from i386 to any -- Bdale Garbee Sat, 15 Apr 2006 11:22:33 -0600 xtrkcad (3.1.4-1) unstable; urgency=low * new upstream version -- Bdale Garbee Sat, 15 Nov 2003 15:23:21 -0700 xtrkcad (3.1.2.3-1) unstable; urgency=low * new upstream version, actually 3.1.2-3 in Sillub's notation * freshen packaging to current standards -- Bdale Garbee Wed, 6 Nov 2002 17:15:48 -0700 xtrkcad (2.2.0-2) unstable; urgency=low * update to current standards, FHS, clean up lintian report -- Bdale Garbee Fri, 7 Jan 2000 21:29:01 -0700 xtrkcad (2.2.0-1) unstable; urgency=low * new upstream version -- Bdale Garbee Wed, 26 May 1999 13:27:32 -0600 xtrkcad (2.0.4-1) unstable; urgency=low * new upstream version, closes 20040 * minor cleanups to files in debian directory to close all Lintian errors, some warnings remain since this is a libc5 binary-only package, etc... -- Bdale Garbee Sun, 6 Sep 1998 12:05:54 -0600 xtrkcad (1.2.1-4) unstable; urgency=low * fix a bunch of packaging funnies found by lintian * move from debstd to debhelper -- Bdale Garbee Sun, 15 Feb 1998 11:45:26 -0700 xtrkcad (1.2.1-3) unstable; urgency=low * add new param files from Sillub web page. These add a P4 scale, update the Walthers HP structure lib, and add libs for Arnold N scale turnouts, Peco HO scale turnouts, and UK P4 fine scale turnouts. There's also a new example layout. Closes bug 16388. * don't gzip example layouts, since they are then invisible to the file menu, which is really confusing. * add support for update-menus. -- Bdale Garbee Sat, 3 Jan 1998 01:14:23 -0700 xtrkcad (1.2.1-2) unstable; urgency=low * moved html stuff out of /usr/lib and into /usr/doc * repackaged to get dependency information right for hamm -- Bdale Garbee Sat, 25 Oct 1997 11:39:58 -0600 xtrkcad (1.2.1-1) unstable; urgency=low * new upstream version, converted with alien and merged with Debian diffs from 1.2.0 * moved from contrib to non-free since no source is available * included example layouts from the Sillub web pages -- Bdale Garbee Sun, 7 Sep 1997 18:21:34 -0600 xtrkcad (1.2.0-2) unstable; urgency=low * Moving from contrib to non-free to meet new policy on such. -- Bdale Garbee Wed, 6 Aug 1997 14:04:12 -0600 xtrkcad (1.2.0-1) unstable; urgency=low * Converted from distributed .tar.gz format to a Debian package -- Bdale Garbee Mon, 31 Mar 1997 17:28:01 -0700 Local variables: mode: debian-changelog End: debian/compat0000644000000000000000000000000211426522651010370 0ustar 5 debian/copyright0000644000000000000000000000212011426522651011120 0ustar This package was debianized by Bdale Garbee on Sat, 15 Apr 2006 01:59:55 -0600. It was downloaded using CVS from http://sourceforge.net/projects/xtrkcad-fork/ Copyright Holder: Dave Bullis License: Copyright (C) 2005 Dave Bullis This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. On Debian GNU/Linux systems, the complete text of the GNU General Public License can be found in `/usr/share/common-licenses/GPL'. debian/source/0000755000000000000000000000000011426532616010474 5ustar debian/source/format0000644000000000000000000000001411515532263011677 0ustar 3.0 (quilt) debian/wrapper.sh0000644000000000000000000000022511426522651011205 0ustar #!/bin/sh # # Wrapper to launch xtrkcad after setting up the environment. # XTRKCADLIB=/usr/lib/xtrkcad export XTRKCADLIB exec $XTRKCADLIB/xtrkcad debian/rules0000755000000000000000000000246711426532757010273 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 build: build-stamp build-stamp: dh_testdir chmod +x app/tools/halibut/charset/sbcsgen.pl (cd app ; $(MAKE) ) touch build-stamp clean: dh_testdir dh_testroot (cd app ; $(MAKE) clean ) rm -f build-stamp dh_clean binary-indep: build binary-arch: build dh_testdir dh_testroot dh_clean -k dh_installdirs cp -r app/lib/* debian/xtrkcad/usr/lib/xtrkcad/ chmod -x debian/xtrkcad/usr/lib/xtrkcad/logo.bmp cp app/doc/*.html debian/xtrkcad/usr/share/xtrkcad/html/ cp -r app/doc/png.d debian/xtrkcad/usr/share/xtrkcad/html/ ln -s ../../share/xtrkcad/html debian/xtrkcad/usr/lib/xtrkcad/html cp app/bin/xtrkcad app/help/xtrkcad.tip \ debian/xtrkcad/usr/lib/xtrkcad/ /usr/bin/install -c -m 755 debian/wrapper.sh \ debian/xtrkcad/usr/bin/xtrkcad rm -f debian/xtrkcad/usr/lib/xtrkcad/COPYING dh_installdocs dh_installmenu dh_installcron dh_installman debian/xtrkcad.1 dh_installchangelogs dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb source diff: @echo >&2 'source and diff are obsolete - use dpkg-source -b'; false binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary