Changeset 76 in projects


Ignore:
Timestamp:
Jul 26, 2013, 3:46:35 PM (11 years ago)
Author:
sven
Message:

Reverted Visualisator to SVN Revision 21, with patches that make the
code compile with current Linuxes. See Ticket #45 and #44 for these issues.

This codebase will form the basis for the PaperTapeViewer in the
Paper Tape Project NG 2013.

Location:
paper-tape-project/trunk/visualisator
Files:
18 added
1 deleted
5 edited

Legend:

Unmodified
Added
Removed
  • paper-tape-project/trunk/visualisator/Makefile

    r73 r76  
    1111cli: cli.c lochstreifen.o
    1212        $(CC) $(CAIRO_CFLAGS) $^ $(CAIRO_LIBS) -lm -o $@
     13
     14
     15#%.o: %.cc %.h
     16#       $(CPP) $(CFLAGS) $(GTKMM_CFLAGS) -c $<
     17
    1318
    1419gtkpapertape.o: gtkpapertape.cc gtkpapertape.h
     
    3439
    3540clean:
    36         rm -fv *.o cli gtk
     41        rm -f *.o cli gtk
  • paper-tape-project/trunk/visualisator/cli.c

    r73 r76  
    250250        long color_value[4]; // interpreted numbers
    251251        char buf[3] = "xy";       // Buffer for strtol <- one color value
    252 
     252       
    253253        // remove a "#" char if present
    254254        if(string[0] == '#')
     
    260260                // copy the current character to buffer, first position
    261261                buf[0] = string[x];
    262 
    263262                // if short notation (shorter than AABBCC), dublicate
    264263                // current character to buffer second position, else
     
    268267                color_value[color] = strtol(buf, NULL, 16);
    269268        }
    270 
     269       
    271270        DPRINTF("Allocating '%s' as #%02x%02x%02x%02x\n", string,
    272271                (unsigned int) color_value[0], (unsigned int) color_value[1], (unsigned int)color_value[2], (color == 4) ? (unsigned int) color_value[3] : 0xFF);
    273 
     272       
    274273        return cairo_pattern_create_rgba(
    275274                (double) color_value[0] / (double) 0xFF,
     
    416415        }
    417416       
    418         if(verbosity!=0)
    419                 lochstreifen_print_debug(l);
     417        lochstreifen_print_debug(l);
     418        exit(0);
    420419
    421420        // setting up the surface and painting...
  • paper-tape-project/trunk/visualisator/gtk.cc

    r22 r76  
    1919        loop.run(win);
    2020}
    21 
    22 
    23 #include "gtkpapertape.h"
    24 
    25 int main(int argc, char** argv) {
    26         Main loop(argc, argv);
    27        
    28         PaperTape::Chrome win;
    29         win.set_app_name("Hello World Application");
    30        
    31         win.show();
    32         loop.run(win);
    33 }
  • paper-tape-project/trunk/visualisator/gtkpapertape.h

    r22 r76  
    22#define __GTK_PAPER_TAPE_H__
    33
    4 /*
    5  * Master include file, like "#include <gtk.h>"
    6  * or "#include <gtkmm>".
     4#include "gtkmm/box.h"
     5#include "gtk/gtk.h"
     6#include <gtkmm/uimanager.h>
     7#include <gtkmm/dialog.h>
     8
     9// predefine for usage in other header files
     10namespace Gtk
     11{ class PaperTape; }
     12#include "gtkpapertapeview.h"
     13#include "gtkpapertapefile.h"
     14
     15typedef unsigned char byte_t;
     16
     17namespace Gtk {
     18
     19/**
     20 * Klasse könnte GtkWidget erweitern und dann selbst das Haupt
     21 * master drumherumwidget sein, was automatisch richtige Kinder
     22 * herzaubert, inkl. Scrolling und beispielsweise greaterzoom-ding.
     23 * Oder dann das IO teil, usw.
    724 *
    8  */
     25 **/
     26class PaperTape : public VBox
     27{
     28       
     29public:
     30        PaperTapeView* view;
     31        PaperTapeFile* model;
     32        Window* parent_window;
     33       
     34private:
     35       
     36        static Glib::ustring ui_info;
     37        static GtkActionEntry ui_common_entries[];
     38        static GtkActionEntry ui_file_entries[];
     39        static GtkActionEntry ui_editor_entries[];
     40        static GtkToggleActionEntry ui_toggle_entries[];
     41        Glib::RefPtr<Gtk::UIManager> ui_manager;
     42        void make_menu();
     43        void menu_actions(const Glib::RefPtr<Action>& action);
    944
    10 #include "lochstreifen.h"
    11 #include "papertape/chrome.h"
    12 #include "papertape/view.h"
    13 #include "papertape/file.h"
     45public:
     46        PaperTape(Window& parent_window);
     47       
     48        /**
     49         * Runs the dialog. This is just like dialog.run(),
     50         * but with the correct parent window (modal dialog),
     51         * which is saved in this widget.
     52         **/
     53        int run_dialog(Dialog& dialog) {
     54                dialog.set_transient_for(*this->parent_window);
     55                return dialog.run();
     56        }
    1457
     58        /**
     59         * Open a blank file. This will ask if user wants to close
     60         * file and open, if yes, a new blank file.
     61         **/
     62        //void new_file();
     63        /**
     64         * Show a file dialog to open an existing file. This will
     65         * ask the user if he wants to close the current file.
     66         **/
     67        //void open_file();
     68        /**
     69         * Ask the user if he wants to close the current file. If so,
     70         * close it, leaving with no file opened (splash screen)
     71         **/
     72        //void close_file();
     73        /**
     74         * Check if a file is opened.
     75         * @returns true if a file is opened.
     76         **/
     77        //boolean file_is_open();
     78};
     79
     80
     81}; // namespace Gtk
    1582#endif // __GTK_PAPER_TAPE_H__
  • paper-tape-project/trunk/visualisator/lochstreifen.c

    r73 r76  
    6868        cairo_matrix_init(&l->matrix, 1, 0, 0, 1, 0, 0); // default = 1:1 original
    6969        l->matrix_inverse             = l->matrix;
    70         l->row_callback               = NULL;
    71         l->row_callback_user_data     = NULL;
    7270
    7371        return l;
     
    940938                cairo_user_to_device(cr, &x, &y);
    941939                cairo_user_to_device_distance(cr, &width, &height);
    942                 //printf("draw: %i|%i %ix%i ", (int)x, (int)y, (int)width, (int)height);
    943         } //else    printf("draw: ");
    944         //printf("row %i->%i track %i->%i\n", row, row_max, track_min, track_max);
     940                printf("draw: %i|%i %ix%i ", (int)x, (int)y, (int)width, (int)height);
     941        } else    printf("draw: ");
     942        printf("row %i->%i track %i->%i\n", row, row_max, track_min, track_max);
    945943       
    946944        // loop all the rows (bytes)
     
    951949                // call row callback
    952950                if(l->row_callback != NULL) {
    953                         printf("CALLING ROW CALLBACK!\n");
    954951                        (*l->row_callback) (&row, cr, l->row_callback_user_data);
    955952                        // at least now that's all the magic ;)
     
    998995                        }
    999996                       
    1000                         //printf("testing byte\n");
    1001997                        if( ((l->data[row] >> track) & 0x01) != 0x01) {
    1002998                                // bit is logical ZERO (0)
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License