Main Page   File List   File Members  

callbacks.c File Reference

#include <stdio.h>
#include <gtk/gtk.h>
#include <gdk-pixbuf/gdk-pixbuf.h>
#include <unistd.h>
#include "callbacks.h"
#include "turtle.h"
#include "mem.h"
#include "io.h"

Functions

void show_window_clb (gpointer window_ref)
void quit_application_clb (GtkWidget *widget, gpointer data)
gint open_program_clb (GtkWidget *widget, gpointer data)
gint new_program_clb (GtkWidget *widget, gpointer data)
gint save_program_clb (GtkWidget *widget, gpointer data)
gint saveas_program_clb (GtkWidget *widget, gpointer data)
gint save_drawing_clb (GtkWidget *widget, gpointer data)
gint switch_logo_locale_clb (gpointer locale)
gint open_aboutbox_clb (GtkWidget *widget, gpointer data)
gint execute_program_clb (GtkButton *button, gpointer source)
gint window_configure_event (GtkWidget *widget, GdkEventConfigure *event)
gint drawarea_configure_event (GtkWidget *widget, GdkEventConfigure *event)
gint drawarea_expose_event (GtkWidget *widget, GdkEventExpose *event)
gint turtled_configure_event (GtkWidget *widget, GdkEventExpose *event)
void show_clbk (GtkWidget *widget, GdkEvent *event, gpointer data)
void show_clbk2 (GtkWidget *widget, GdkEvent *event, gpointer data)
void open_callback (GtkWidget *widget, GdkEvent *event, gpointer data)
void destroy (GtkWidget *widget, gpointer data)

Variables

s_turtle my_turtle

Detailed Description

Author:
Guillaume Bour. 2000/2001
Version:
0.1
Date:
2002/07/21
2002/08/05 - debugging
interface callback functions (called by buttons, menus, ...)


Function Documentation

gint drawarea_configure_event GtkWidget *    widget,
GdkEventConfigure *    event
 

Post-drawarea creation configure event.

Parameters:
widget  unused
event  unused
Returns:
the status (ok/nok)

gint drawarea_expose_event GtkWidget *    widget,
GdkEventExpose *    event
 

expose event - redraw the drawing area.

Parameters:
widget  the drawarea
event  the box to redraw
Returns:
the status (ok/nok)

gint execute_program_clb GtkButton *    button,
gpointer    source
 

Compile & execute the logo program currently set.

Remarks:
Parameters:
widget  unused
user  data unused
Returns:
the status (ok/nok)

gint new_program_clb GtkWidget *    widget,
gpointer    data
 

New logo program callback.
Clear the current program (with confirmation => might be configurable)

Parameters:
widget  the file-selection widget
user  data unused
Returns:
the status (ok/nok)

gint open_aboutbox_clb GtkWidget *    widget,
gpointer    data
 

Create & show about box.

Remarks:
+ instanciate it at creation time ??
Parameters:
widget  unused
user  data unused
Returns:
the status (ok/nok)

gint open_program_clb GtkWidget *    widget,
gpointer    data
 

Open logo program callback.
Load the logo program into

Remarks:
the widget contain the filename to open
Parameters:
widget  the file-selection widget
user  data unused
Returns:
the status (ok/nok)

void quit_application_clb GtkWidget *    widget,
gpointer    data
 

Quit the application. Must perform all desinitialisation things (for the moment, nothing :)

Parameters:
widget  unused
data  optional user data (unused)
Returns:
nil

gint save_drawing_clb GtkWidget *    widget,
gpointer    data
 

Save the current drawing.

Remarks:
+ the widget contain the filename to open
Parameters:
widget  the file-selection widget
user  data unused
Returns:
the status (ok/nok)

gint save_program_clb GtkWidget *    widget,
gpointer    data
 

Save the current logo program callback.
+ if it as been previously saved, override previous version + if not, ask for a program path/name

Remarks:
+ the widget contain the filename to open + if the program has not been modified since last save, do nothing
Parameters:
widget  the file-selection widget
user  data unused
Returns:
the status (ok/nok)

gint saveas_program_clb GtkWidget *    widget,
gpointer    data
 

Save as the current logo program callback.
+ ask the program path/name to save to

Remarks:
+ if the program has not been modified since last save, do nothing
Parameters:
widget  the file-selection widget
user  data unused
Returns:
the status (ok/nok)

void show_window_clb gpointer    window_ref
 

Show specified dialog window ('Open program', 'Save as program', ...).

Remarks:
+ It's a generic function
Parameters:
window_ref  the window to open (index)
Returns:
the status (showing ok/nok)

gint switch_logo_locale_clb gpointer    locale
 

Switch logo locale.

Remarks:
+ the locale is contained into the date + we must switch the current locale pixmap
Parameters:
locale  the logo locale to use (of locale_t type)
Returns:
the status (ok/nok)

gint window_configure_event GtkWidget *    widget,
GdkEventConfigure *    event
 

Post-window open configure event.

Parameters:
widget  unused
user  data unused
Returns:
the status (ok/nok)


Generated on Tue Aug 6 13:21:19 2002 for lafontaine by doxygen1.2.15