/* Response signal handler. This function is needed because GtkDialog's * handler for this signal closes the dialog and we don't want that, we * want to change pages and, dimm certain response buttons. Overriding the * virtual function would not work because that would be called after the * signal handler implemented by GtkDialog. * FIXME: There is a much saner way to do that [MDK] */ static void response (HildonWizardDialog *wizard_dialog, gint response_id, gpointer unused) { HildonWizardDialogPrivate *priv = HILDON_WIZARD_DIALOG_GET_PRIVATE (wizard_dialog); GtkNotebook *notebook = priv->notebook; gint current = 0; gint last = gtk_notebook_get_n_pages (notebook) - 1; gboolean is_first, is_last; g_assert (priv); current = gtk_notebook_current_page (notebook); switch (response_id) { case HILDON_WIZARD_DIALOG_PREVIOUS: --current; is_last = (current == last); is_first = (current == 0); make_buttons_sensitive (wizard_dialog, !is_first, !is_first, !is_last); gtk_notebook_prev_page (notebook); /* go to previous page */ break; case HILDON_WIZARD_DIALOG_NEXT: if (!priv->forward_function || (*priv->forward_function) (priv->notebook, current, priv->forward_function_data)) { ++current; is_last = (current == last); is_first = (current == 0); make_buttons_sensitive (wizard_dialog, !is_first, !is_first, !is_last); gtk_notebook_next_page (notebook); /* go to next page */ } break; case HILDON_WIZARD_DIALOG_FINISH: return; } current = gtk_notebook_get_current_page (notebook); is_last = current == last; is_first = current == 0; /* Don't let the dialog close */ g_signal_stop_emission_by_name (wizard_dialog, "response"); /* New page number may appear in the title, update it */ if (priv->autotitle) create_title (wizard_dialog); }
int main(int argc, char **argv) { int ret; char kernel_src_dir[KER_SRC_DIR_LEN_MAX]; create_title(); if (argc >= 2) { if (strlen(argv[1]) >= KER_SRC_DIR_LEN_MAX) printf("/* error: src dir was too long (<%d)! */\n", KER_SRC_DIR_LEN_MAX); strncpy(kernel_src_dir, argv[1], KER_SRC_DIR_LEN_MAX); } printf("/* src dir:%s */\n", kernel_src_dir); if (!access(kernel_src_dir, 0)) { sprintf(git_dir, "%s/%s", kernel_src_dir, git_name); sprintf(get_gitinfo, "cd %s; %s > %s/%s", kernel_src_dir, cmd_get_gitinfo, kernel_src_dir, git_commit_file); if (!access(git_dir, 0)) { ret = system(get_gitinfo); if (ret == -1) printf("/* error: git log cmd error! */\n"); } else printf("/* error: .git not exist! */\n"); sprintf(git_branch_dir, "%s/%s", kernel_src_dir, git_branch_file); sprintf(git_config_dir, "%s/%s", kernel_src_dir, git_config_file); sprintf(git_commit_dir, "%s/%s", kernel_src_dir, git_commit_file); } else printf("/* error: src dir not exist! */\n"); create_file(); return 0; }
al_rest(5.0); } void quitter(){quitter_jeu(partie);} p=jouer; titres[0]=*creer_titre(image_titre_s,image_titre_d,*p); p=credits; titres[1]=*creer_titre(image_credit_s,image_credit_d,*p); p=quitter; titres[2]=*creer_titre(image_quitter_s,image_quitter_d,*p); */ void (*p)(void); void f(){control_menu(menu,control);} titles[0]=*create_title(image_titre_s,image_titre_d,*p); if (!menu ){ printf("bug menu\n"); } // HERE display_menu(menu); al_flip_display(); al_rest(1.0); al_flush_event_queue(control->event); control_menu(menu,control); return 0 ; }
static void hildon_wizard_dialog_set_property (GObject *object, guint property_id, const GValue *value, GParamSpec *pspec) { HildonWizardDialogPrivate *priv = HILDON_WIZARD_DIALOG_GET_PRIVATE (object); GtkDialog *dialog = GTK_DIALOG (object); g_assert (priv); switch (property_id) { case PROP_AUTOTITLE: priv->autotitle = g_value_get_boolean (value); if (priv->autotitle && priv->wizard_name && priv->notebook) create_title (HILDON_WIZARD_DIALOG (object)); else if (priv->wizard_name) gtk_window_set_title (GTK_WINDOW (object), priv->wizard_name); break; case PROP_NAME: /* Set new wizard name. This name will appear in titlebar */ if (priv->wizard_name) g_free (priv->wizard_name); gchar *str = (gchar *) g_value_get_string (value); g_return_if_fail (str != NULL); priv->wizard_name = g_strdup (str); /* We need notebook in order to create title, since page information is used in title generation */ if (priv->notebook && priv->autotitle) create_title (HILDON_WIZARD_DIALOG (object)); break; case PROP_NOTEBOOK: { GtkNotebook *book = GTK_NOTEBOOK (g_value_get_object (value)); g_return_if_fail (book != NULL); priv->notebook = book; /* Set the default properties for the notebook (disable tabs, * and remove borders) to make it look like a nice wizard widget */ gtk_notebook_set_show_tabs (priv->notebook, FALSE); gtk_notebook_set_show_border (priv->notebook, FALSE); gtk_box_pack_start_defaults (GTK_BOX (dialog->vbox), GTK_WIDGET (priv->notebook)); /* Show the notebook so that a gtk_widget_show on the dialog is * all that is required to display the dialog correctly */ gtk_widget_show (GTK_WIDGET (priv->notebook)); /* Update dialog title to reflect current page stats etc */ if (priv->wizard_name && priv->autotitle) create_title (HILDON_WIZARD_DIALOG (object)); } break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); break; } }