Changeset 9 in projects for puncher/frontend.gtk.c


Ignore:
Timestamp:
Aug 29, 2008, 1:24:03 AM (11 years ago)
Author:
sven
Message:
  • Recreated Makefiles in visualisator/ and puncher/
  • All /visualisator/ sources now compile with -Wall compiler flag
  • The basic /puncher/ sources compile with -Wall, too.
  • Added Readme for schriften/

Current development is now focussed at /puncher/frontend.gtk.c.

-- Sven @ workstation

File:
1 edited

Legend:

Unmodified
Added
Removed
  • puncher/frontend.gtk.c

    r8 r9  
    66 *
    77 * started at 14.06.2008
    8  * (c) Sven
     8 * (c) Copyright 2008 Sven Köppel
    99 *
    1010 *
     
    3333        } state;
    3434       
     35        /* The holy backend: */
     36        PuncherBackend *backend;
     37       
    3538        /* Various GtkWidgets: */
    3639        GtkWidget *progress_bar;                // The GtkProgressBar
     
    6871
    6972gboolean progress_update_time();
     73gboolean puncher_frontend_punch_loop();
    7074
    7175void puncher_frontend_prepare(GtkWidget *window) {
     
    165169                gtk_paper_tape_set_highlight(d.papertape, x, TRUE); // TRUE: Abhängig von Checkbox!
    166170                UPDATE_GTK_GUI;
    167                 punch_byte(d.data[x]);
     171                puncher_backend_write_byte(d.backend, d.data[x]);
    168172                d.punched++;
    169173        }
     
    251255
    252256void puncher_frontend_quit_application(GtkWidget *window, gpointer *nada) {
    253         puncher_backend_finish();
     257        puncher_backend_destroy(d.backend);
    254258        exit(0);
    255259        // on window close: manage punching interaction!!
     
    366370               
    367371                gtk_container_add(GTK_CONTAINER(button_box), d.button_start);
    368                 g_signal_connect(G_OBJECT(d.button_start), "clicked", G_CALLBACK(gui_puncher_start), NULL);
     372                g_signal_connect(G_OBJECT(d.button_start), "clicked", G_CALLBACK(puncher_frontend_puncher_start), NULL);
    369373                gtk_container_add(GTK_CONTAINER(button_box), d.button_pause);
    370374                gtk_container_add(GTK_CONTAINER(button_box), d.button_stop);
     
    404408        }
    405409        // end of parsing command options
    406 
     410       
     411        // showing the main window
    407412        gtk_widget_show_all(window);
     413       
     414        // Initialisation of the backend
     415        d.backend = puncher_backend_new(1);
     416       
     417        if(!d.backend) {
     418                perror("backend init");
     419                GtkWidget *error;
     420                error = gtk_message_dialog_new (GTK_WINDOW(window),
     421                        GTK_DIALOG_DESTROY_WITH_PARENT,
     422                        GTK_MESSAGE_ERROR,
     423                        GTK_BUTTONS_OK,
     424                        "Error while initializing backend! Quitting!",
     425                        "dumy");
     426                gtk_dialog_run (GTK_DIALOG (error));
     427                gtk_widget_destroy (error);
     428                return 1;
     429        }
     430
    408431        gtk_main();
    409432        return 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