#include <gtk/gtk.h>
-#include <assert.h>
+#include "simp.h"
-void chess_file_new(GtkMenuButton* self, gpointer user_data)
-{
- printf("%s(),%d\n", __func__, __LINE__);
-
- GtkBuilder *builder;
- GtkNotebook *code_notebook;
- GtkWidget *code_page;
+GtkWidget* gl_area = NULL;
- builder = GTK_BUILDER(user_data);
-}
-
-void chess_file_open(GtkMenuButton* self, gpointer user_data)
+void simp_file_add(GtkMenuButton* self, gpointer user_data)
{
printf("%s(),%d\n", __func__, __LINE__);
-
+#if 0
GtkBuilder *builder;
GtkWindow *window;
GtkWidget *dialog;
GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_OPEN;
- dialog = gtk_file_chooser_dialog_new ("Open File",
+ dialog = gtk_file_chooser_dialog_new ("add source",
window,
action,
"_Cancel",
gtk_widget_show(dialog);
g_signal_connect(dialog, "response", G_CALLBACK(on_open_response), NULL);
+#endif
}
-void chess_file_save(GtkMenuButton* self, gpointer user_data)
-{
- printf("%s(),%d\n", __func__, __LINE__);
-}
-
-void chess_file_save_as(GtkMenuButton* self, gpointer user_data)
-{
- printf("%s(),%d\n", __func__, __LINE__);
-
- GtkBuilder *builder;
- GtkWindow *window;
- GtkWidget *dialog;
-
- builder = GTK_BUILDER(user_data);
- window = GTK_WINDOW(gtk_builder_get_object(builder, "main_window"));
-
- GtkFileChooserAction action = GTK_FILE_CHOOSER_ACTION_SAVE;
-
- dialog = gtk_file_chooser_dialog_new ("Save File",
- window,
- action,
- "_Cancel",
- GTK_RESPONSE_CANCEL,
- "_Save",
- GTK_RESPONSE_ACCEPT,
- NULL);
-
- gtk_widget_show(dialog);
-
- g_signal_connect(dialog, "response", G_CALLBACK(on_save_response), NULL);
-}
-
-void chess_edit_reset(GtkMenuButton* self, gpointer user_data)
+void simp_edit_play(GtkMenuButton* self, gpointer user_data)
{
printf("%s(),%d\n", __func__, __LINE__);
if (gtk_gl_area_get_error (area) != NULL)
return FALSE;
- glViewport(0, 0, 512, 512);
+ glViewport(0, 0, 1920, 1080);
glClearColor (1.0, 0.0, 0.0, 1.0);
glClear (GL_COLOR_BUFFER_BIT);
-// chess_gl_draw(gl);
+ // draw
glFlush ();
return TRUE;
}
+static gboolean simp_record(GtkWidget* self, GdkEventButton* event, gpointer user_data)
+{
+ printf("%s(),%d\n", __func__, __LINE__);
+ return TRUE;
+}
+
+static gboolean simp_pause(GtkWidget* self, GdkEventButton* event, gpointer user_data)
+{
+ printf("%s(),%d\n", __func__, __LINE__);
+ return TRUE;
+}
+
+static gboolean simp_stop(GtkWidget* self, GdkEventButton* event, gpointer user_data)
+{
+ printf("%s(),%d\n", __func__, __LINE__);
+ return TRUE;
+}
int main(int argc, char *argv[])
{
printf("%s(),%d\n", __func__, __LINE__);
GtkBuilder *builder;
- GObject *window;
-
- GObject *menu_file_quit;
- GObject *menu_file_new;
- GObject *menu_file_open;
- GObject *menu_file_save;
- GObject *menu_file_save_as;
- GObject *menu_edit_back;
- GObject *menu_edit_next;
- GObject *menu_edit_mode;
- GObject *menu_edit_reset;
- GError *error = NULL;
+ GObject *window;
+
+ GObject *menu_file_quit;
+ GObject *menu_file_add;
+
+ GObject *button_record;
+ GObject *button_pause;
+ GObject *button_stop;
+
+ GError *error = NULL;
gtk_init (&argc, &argv);
-#if 1
- builder = gtk_builder_new ();
- if (gtk_builder_add_from_file (builder, "chess.glade", &error) == 0)
+
+ builder = gtk_builder_new();
+ if (gtk_builder_add_from_file (builder, "simp.glade", &error) == 0)
{
g_printerr ("Error loading file: %s\n", error->message);
g_clear_error (&error);
return 1;
}
-#endif
- window = gtk_builder_get_object (builder, "main_window");
- g_signal_connect (window, "destroy", G_CALLBACK (gtk_main_quit), NULL);
-
-#if 1
- menu_file_quit = gtk_builder_get_object (builder, "menu_file_quit");
- menu_file_new = gtk_builder_get_object (builder, "menu_file_new");
- menu_file_open = gtk_builder_get_object (builder, "menu_file_open");
- menu_file_save = gtk_builder_get_object (builder, "menu_file_save");
- menu_file_save_as = gtk_builder_get_object (builder, "menu_file_save_as");
-
- menu_edit_back = gtk_builder_get_object (builder, "menu_edit_back");
- menu_edit_next = gtk_builder_get_object (builder, "menu_edit_next");
- menu_edit_reset = gtk_builder_get_object (builder, "menu_edit_reset");
-
- g_signal_connect(menu_file_quit, "activate", G_CALLBACK(gtk_main_quit), NULL);
- g_signal_connect(menu_file_new, "activate", G_CALLBACK(chess_file_new), builder);
- g_signal_connect(menu_file_open, "activate", G_CALLBACK(chess_file_open), builder);
- g_signal_connect(menu_file_save, "activate", G_CALLBACK(chess_file_save), builder);
- g_signal_connect(menu_file_save_as, "activate", G_CALLBACK(chess_file_save_as), builder);
-
- g_signal_connect(menu_edit_back, "activate", G_CALLBACK(chess_edit_back), builder);
- g_signal_connect(menu_edit_next, "activate", G_CALLBACK(chess_edit_next), builder);
- g_signal_connect(menu_edit_reset, "activate", G_CALLBACK(chess_edit_reset), builder);
- g_signal_connect(menu_edit_mode, "activate", G_CALLBACK(chess_edit_mode), builder);
-#endif
- gl_area = GTK_WIDGET(gtk_builder_get_object(builder, "gl_area"));
+ window = gtk_builder_get_object (builder, "main_window");
+
+ menu_file_quit = gtk_builder_get_object (builder, "menu_file_quit");
+ menu_file_add = gtk_builder_get_object (builder, "menu_file_add");
+
+ button_record = gtk_builder_get_object (builder, "button_record");
+ button_pause = gtk_builder_get_object (builder, "button_pause");
+ button_stop = gtk_builder_get_object (builder, "button_stop");
+
+ gl_area = GTK_WIDGET(gtk_builder_get_object(builder, "gl_area"));
+
+ g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
+
+ g_signal_connect(menu_file_quit, "activate", G_CALLBACK(gtk_main_quit), NULL);
+ g_signal_connect(menu_file_add, "activate", G_CALLBACK(simp_file_add), builder);
+
+ g_signal_connect(button_record, "activate", G_CALLBACK(simp_record), builder);
+ g_signal_connect(button_pause, "activate", G_CALLBACK(simp_pause), builder);
+ g_signal_connect(button_stop, "activate", G_CALLBACK(simp_stop), builder);
- g_signal_connect (gl_area, "resize", G_CALLBACK (resize), NULL);
- g_signal_connect (gl_area, "unrealize", G_CALLBACK (unrealize), NULL);
- g_signal_connect (gl_area, "render", G_CALLBACK (render), NULL);
+ g_signal_connect(gl_area, "resize", G_CALLBACK(resize), NULL);
+ g_signal_connect(gl_area, "unrealize", G_CALLBACK(unrealize), NULL);
+ g_signal_connect(gl_area, "render", G_CALLBACK(render), NULL);
- g_signal_connect (window, "button-release-event", G_CALLBACK (button_release_event), NULL);
+ g_signal_connect(window, "button-release-event", G_CALLBACK(button_release_event), NULL);
gtk_widget_show_all(GTK_WIDGET(window));