Back to index

im-sdk  12.3.91
Defines | Functions
lookup_aux.c File Reference
#include <stdio.h>
#include "lookup_aux.h"

Go to the source code of this file.

Defines

#define _(s)   (s)

Functions

void lookup_window_hide (lookup_window_t *lookup_window)
GtkWidget * lookup_window_create_symbols_page (lookup_window_t *lookup_window)
GtkWidget * lookup_window_create_charmap_page (lookup_window_t *lookup_window)
void lookup_window_click_ok_button_callback (GtkButton *button, gpointer user_data)
gboolean lookup_window_delete_callback (GtkWidget *widget, GdkEvent *event, gpointer user_data)
lookup_window_tlookup_window_new ()
void lookup_window_destroy (lookup_window_t *lookup_window)
void lookup_window_print (lookup_window_t *lookup_window)
void lookup_window_show (lookup_window_t *lookup_window)

Define Documentation

#define _ (   s)    (s)

Definition at line 5 of file lookup_aux.c.


Function Documentation

void lookup_window_click_ok_button_callback ( GtkButton *  button,
gpointer  user_data 
)
GtkWidget* lookup_window_create_charmap_page ( lookup_window_t lookup_window)
GtkWidget* lookup_window_create_symbols_page ( lookup_window_t lookup_window)
gboolean lookup_window_delete_callback ( GtkWidget *  widget,
GdkEvent *  event,
gpointer  user_data 
)
void lookup_window_destroy ( lookup_window_t lookup_window)

Definition at line 86 of file lookup_aux.c.

{
    if (lookup_window == NULL)
        return;

    if (lookup_window->lookup_data) {
        lookup_data_destroy(lookup_window->lookup_data);
    }

    if (lookup_window->window)
        gtk_widget_destroy(lookup_window->window);

    free ((char *)lookup_window);
}

Here is the call graph for this function:

void lookup_window_hide ( lookup_window_t lookup_window)

Definition at line 16 of file lookup_aux.c.

{
    GtkWidget *window;
    GtkWidget *vbox;
    GtkWidget *notebook;
    GtkWidget *ok_button;
    GtkWidget *label;
    GtkWidget *symbols_page;
    GtkWidget *charmap_page;
    GtkWidget *hbox;
    lookup_window_t *lookup_window = NULL;

    lookup_window = (lookup_window_t *) calloc(1, sizeof(lookup_window_t));
    if (lookup_window == NULL)
        return NULL;

    lookup_window->lookup_data = (lookup_data_t *)lookup_data_new();
    lookup_data_print(lookup_window->lookup_data);

    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_accept_focus (GTK_WINDOW(window), FALSE);
    gtk_window_set_title(GTK_WINDOW(window), _("window"));
    lookup_window->window = window;

    vbox = gtk_vbox_new(FALSE, 6);
    gtk_widget_show(vbox);
    gtk_container_add(GTK_CONTAINER(window), vbox);

    notebook = gtk_notebook_new();
    gtk_widget_show(notebook);
    gtk_notebook_set_scrollable (GTK_NOTEBOOK(notebook), TRUE);
    gtk_notebook_popup_enable (GTK_NOTEBOOK(notebook));
    gtk_box_pack_start(GTK_BOX(vbox), notebook, FALSE, FALSE, 6);

    label = gtk_label_new(_("symbols page"));
    gtk_widget_show(label);

    symbols_page = (GtkWidget *)lookup_window_create_symbols_page(lookup_window);
    gtk_notebook_append_page (GTK_NOTEBOOK (notebook), symbols_page, label);

    label = gtk_label_new(_("charmap page"));
    gtk_widget_show(label);

    charmap_page = lookup_window_create_charmap_page(lookup_window);
    gtk_notebook_append_page (GTK_NOTEBOOK (notebook), charmap_page, label);

    // Create hbox for button area.
    hbox = gtk_hbox_new (FALSE, 0);
    gtk_widget_show (hbox);
    gtk_box_pack_start(GTK_BOX (vbox), hbox, FALSE, FALSE, 8);

    ok_button = gtk_button_new_from_stock ("gtk-ok");
    gtk_widget_show (ok_button);
    gtk_box_pack_end (GTK_BOX (hbox), ok_button, FALSE, FALSE, 4);
    GTK_WIDGET_SET_FLAGS (ok_button, GTK_CAN_DEFAULT);

    g_signal_connect ((gpointer) ok_button, "clicked",
                      G_CALLBACK (lookup_window_click_ok_button_callback),
                      lookup_window);
    g_signal_connect (G_OBJECT (window), "delete_event",
                      G_CALLBACK (lookup_window_delete_callback),
                      lookup_window);

    gtk_widget_grab_default (ok_button);

    gtk_widget_realize(window);

    return lookup_window;
}

Here is the call graph for this function:

void lookup_window_print ( lookup_window_t lookup_window)

Definition at line 101 of file lookup_aux.c.

{
    if (lookup_window == NULL)
        return;

    if (lookup_window->lookup_data) {
        lookup_data_print(lookup_window->lookup_data);
    }
}

Here is the call graph for this function:

void lookup_window_show ( lookup_window_t lookup_window)

Definition at line 111 of file lookup_aux.c.

{
    if (lookup_window == NULL)
        return;

    if (lookup_window->window) {
        gtk_widget_show (lookup_window->window);
        gdk_window_raise (lookup_window->window->window);
    }
}