Backend support for using dynamic styles. See also Ticket #49.
[rodin/chimara.git] / tests / styletest.c
index 7b976d0627b563eb043bbfe99d9942261ce2b862..8ed77372268c74d3662adc8a5222636a2942a70c 100644 (file)
@@ -16,6 +16,10 @@ void glk_main(void)
 {
        char stringbuffer[128];
     event_t ev;
+
+       /* Define some custom styles */
+       glk_stylehint_set(wintype_AllTypes, style_User1, stylehint_TextColor, 0x00FF0000);
+
     mainwin = glk_window_open(0, 0, 0, wintype_TextBuffer, 0);
     if(!mainwin)
         return;
@@ -28,7 +32,6 @@ void glk_main(void)
     assert(buffer);
     
     glk_put_string("Welcome to the style test\n");
-       glk_put_string("int finish_text_grid_line_input(winid_t win, gboolean\n          11 static void cancel_old_input_request(winid_t win);\n         12 \n            13 /* Internal function: code common to both flavors of char ev\n                              14 void\n                                15 request_char_event_common(winid_t win, gboolean unicode)\n                            16 {\n                                   17     VALID_WINDOW(win, return);\n                                  18     g_return_if_fail(win->type != wintype_TextBuffer || win-\n                                        19 \n                                    20     cancel_old_input_request(win);\n                                          21 \n                                                22     flush_window_buffer(win);\n                                               23 \n                                            24     ChimaraGlkPrivate *glk_data = g_private_get(glk_data_key\n                                                25 \n                                                        26     win->input_request_type = unicode? INPUT_REQUEST_CHARACT\n                                                        27     g_signal_handler_unblock( win->widget, win->char_input_k\n                                                        28 \n                                                            29     gdk_threads_enter();\n                                                                30 \n                                                            31     /*\n                                                              32     if(win->type == wintype_TextBuffer)\n                                                             33     {\n                                                                   34         GtkTextBuffer *buffer = gtk_text_view_get_buffer( GT\n                                                                        35         GtkTextIter iter;\n                                                                           36         gtk_text_buffer_get_end_iter(buffer, &iter);\n                                                                        37         gtk_text_buffer_place_cursor(buffer, &iter);\n                                                                            38         gtk_text_view_scroll_mark_onscreen(GTK_TEXT_VIEW(win\n                                                                                39         // Why doesn't this always work?? \n                                                                                  40     } */\n                   41 \n                    42     gtk_widget_grab_focus( GTK_WIDGET(win->widget) );\n    43     gdk_threads_leave();\n    44 \n                                            47 }\n                                               48 \n                                            49 /**\n                                                 50  * glk_request_char_event:\n                                                  51  * @win: A window to request char events from.\n                                                  52  *\n                                                          53  * Request input of a Latin-1 character or special key. A wi\n                                                        54  * requests for both character and line input at the same ti\n                                                        55  * requests for character input of both types (Latin-1 and U\n                                                            56  * illegal to call glk_request_char_event() if the window al\n                                                                57  * request for either character or\n");
     glk_request_line_event(mainwin, buffer, 255, 0);
     while(strncmp(buffer, "quit", 4)) 
     {