Exemple #1
0
/**
 * @param p: the popup to initialize
 * @return Returns TRUE on success, FALSE on failure.
 * @brief Initialize the popup and inherited fields
 *
 * Clears the contents of the popup and stores the
 * default values.
 */
int
ewl_popup_init(Ewl_Popup *p)
{
        Ewl_Widget *w;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR_RET(p, FALSE);

        w = EWL_WIDGET(p);
        if (!ewl_window_init(EWL_WINDOW(w)))
                DRETURN_INT(FALSE, DLEVEL_STABLE);

        ewl_widget_inherit(w, EWL_POPUP_TYPE);
        ewl_widget_appearance_set(w, EWL_POPUP_TYPE);
        ewl_object_fill_policy_set(EWL_OBJECT(p), EWL_FLAG_FILL_NONE);

        ewl_window_override_set(EWL_WINDOW(p), TRUE);

        ewl_container_show_notify_set(EWL_CONTAINER(p),
                                        ewl_popup_cb_child_show);
        ewl_container_resize_notify_set(EWL_CONTAINER(p),
                                        ewl_popup_cb_child_resize);

        /*
         * add the callbacks
         */
        ewl_callback_append(w, EWL_CALLBACK_SHOW, ewl_popup_cb_show, NULL);
        ewl_callback_append(w, EWL_CALLBACK_CONFIGURE, ewl_popup_cb_show, NULL);
        ewl_callback_append(w, EWL_CALLBACK_MOUSE_MOVE, ewl_popup_cb_mouse_move,
                                                                        NULL);
        ewl_callback_prepend(w, EWL_CALLBACK_DESTROY, ewl_popup_cb_destroy,
                                                                        NULL);

        DRETURN_INT(TRUE, DLEVEL_STABLE);
}
Exemple #2
0
int
inspector_init( void )
{
	char *header[] = {"Attribute", "Value"};

	if( inspector_win )
		return -1;

	name_spec = spec_elem_get("Ewl_Widget", "name");

	inspector_win = ewl_window_new();
	ewl_window_title_set(EWL_WINDOW(inspector_win), "Inspector");
	ewl_object_size_request(EWL_OBJECT(inspector_win), 200, 320);
	ewl_callback_append(inspector_win, EWL_CALLBACK_DELETE_WINDOW,
											inspector_toggle, NULL);

	tree = ewl_tree_new(2);
	ewl_tree_headers_set(EWL_TREE(tree), header);
	ewl_tree_mode_set(EWL_TREE(tree), EWL_TREE_MODE_NONE);
	ewl_container_child_append(EWL_CONTAINER(inspector_win), tree);
	ewl_widget_show(tree);

	ewl_widget_show(inspector_win);

	return 0;
}
Exemple #3
0
/**
 * @param menu: the menu to work with
 * @return Returns no value
 * @brief Expand the popup portion of the menu
 */
void
ewl_menu_expand(Ewl_Menu *menu)
{
        Ewl_Menu_Item *item;

        DENTER_FUNCTION(DLEVEL_STABLE);
        DCHECK_PARAM_PTR(menu);
        DCHECK_TYPE(menu, EWL_MENU_TYPE);

        item = EWL_MENU_ITEM(menu);

        /* nothing to do if the popup is already visible */
        if (VISIBLE(menu->popup))
                DRETURN(DLEVEL_STABLE);

        ewl_widget_show(menu->popup);
        ewl_window_raise(EWL_WINDOW(menu->popup));

        if (item->inmenu) {
                Ewl_Context_Menu *cm;

                cm = EWL_CONTEXT_MENU(item->inmenu);
                cm->open_menu = EWL_WIDGET(menu);
        }
        else
                ewl_widget_focus_send(menu->popup);

        DLEAVE_FUNCTION(DLEVEL_STABLE);
}
Exemple #4
0
int
tools_init( void )
{
	Ewl_Widget *vbox, *button, *image;

	if( tools_win )
		return -1;

	tools_win = ewl_window_new();
	ewl_window_title_set(EWL_WINDOW(tools_win), "Tools");
	ewl_object_size_request(EWL_OBJECT(tools_win), 200, 320);
	ewl_callback_append(tools_win, EWL_CALLBACK_DELETE_WINDOW,
											tools_toggle, NULL);

	vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(tools_win), vbox);

	button = ewl_button_new(NULL);
	ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
	ewl_object_insets_set(EWL_OBJECT(button), 0, 0, 0, 0);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, tools_click, "Ewl_Text");
	ewl_container_child_append(EWL_CONTAINER(vbox), button);

	image = ewl_image_new(EWLER_IMAGE_DIR"/text-small.png", "text");
	ewl_container_child_append(EWL_CONTAINER(button), image);
	ewl_widget_show(image);

	ewl_widget_show(button);

	button = ewl_button_new(NULL);
	ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
	ewl_object_insets_set(EWL_OBJECT(button), 0, 0, 0, 0);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, tools_click, "Ewl_Entry");
	ewl_container_child_append(EWL_CONTAINER(vbox), button);

	image = ewl_image_new(EWLER_IMAGE_DIR"/entry-small.png", "entry");
	ewl_container_child_append(EWL_CONTAINER(button), image);
	ewl_widget_show(image);

	ewl_widget_show(button);

	button = ewl_button_new(NULL);
	ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
	ewl_object_insets_set(EWL_OBJECT(button), 0, 0, 0, 0);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, tools_click, "Ewl_Border");
	ewl_container_child_append(EWL_CONTAINER(vbox), button);

	image = ewl_image_new(EWLER_IMAGE_DIR"/border-small.png", "border");
	ewl_container_child_append(EWL_CONTAINER(button), image);
	ewl_widget_show(image);

	ewl_widget_show(button);

	ewl_widget_show(vbox);
	
	ewl_widget_show(tools_win);

	return 0;
}
Exemple #5
0
int main(int argc, char ** argv) {
    Ewl_Widget *win = NULL;

    if (!ewl_init(&argc, argv)) {
        printf("Unable to init ewl\n");
        return 1;
    }

    win = ewl_window_new();
    ewl_window_title_set(EWL_WINDOW(win), "EWL Window");
    ewl_window_name_set(EWL_WINDOW(win), "EWL_WINDOW");
    ewl_window_class_set(EWL_WINDOW(win), "EWLWindow");
    ewl_object_size_request(EWL_OBJECT(win), 200, 100);

    ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL);
    ewl_widget_show(win);

    ewl_main();

    return 0;
}
Exemple #6
0
static void
eke_gui_ewl_manage_feed_cb(Ewl_Widget *w, void *ev, void *data)
{
    Eke *eke;
    Ewl_Widget *win, *box, *button;

    eke = data;

    win = ewl_dialog_new(EWL_POSITION_BOTTOM);
    ewl_window_title_set(EWL_WINDOW(win), PACKAGE " -- manage feeds");
    ewl_window_name_set(EWL_WINDOW(win), PACKAGE);
    ewl_window_class_set(EWL_WINDOW(win), PACKAGE);
    ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
                            eke_gui_ewl_manage_feed_exit_cb, win);
    ewl_widget_show(win);

    box = ewl_vbox_new();
    ewl_dialog_widget_add(EWL_DIALOG(win), box);
    ewl_widget_show(box);

    button = ewl_button_new("add feed");
    ewl_widget_data_set(button, "manage_feed_win", win);
    ewl_container_child_append(EWL_CONTAINER(box), button);
    ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
    ewl_callback_append(button, EWL_CALLBACK_CLICKED,
                                eke_gui_ewl_add_feed_cb, eke);
    ewl_widget_show(button);

    button = ewl_button_stock_with_id_new(EWL_STOCK_CANCEL,
                                            EWL_RESPONSE_CANCEL);
    ewl_container_child_append(EWL_CONTAINER(win), button);
    ewl_object_fill_policy_set(EWL_OBJECT(button), EWL_FLAG_FILL_SHRINK);
    ewl_callback_append(button, EWL_CALLBACK_VALUE_CHANGED,
                                eke_gui_ewl_manage_feed_exit_cb, win);
    ewl_widget_show(button);

    return;
    w = NULL;
    ev = NULL;
}
Exemple #7
0
void
eke_gui_ewl_create(Eke *eke)
{
    Ewl_Widget *box, *body;

    eke->gui.ewl.win = ewl_window_new();
    ewl_window_title_set(EWL_WINDOW(eke->gui.ewl.win), PACKAGE);
    ewl_window_class_set(EWL_WINDOW(eke->gui.ewl.win), PACKAGE);
    ewl_window_name_set(EWL_WINDOW(eke->gui.ewl.win), PACKAGE);
    ewl_object_size_request(EWL_OBJECT(eke->gui.ewl.win), EKE_GUI_WIDTH, EKE_GUI_HEIGHT);
    ewl_callback_append(eke->gui.ewl.win, EWL_CALLBACK_DELETE_WINDOW,
                                                    eke_gui_ewl_exit_cb, NULL);
    ewl_widget_show(eke->gui.ewl.win);

    box = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(eke->gui.ewl.win), box);
    ewl_widget_show(box);

    eke->gui.ewl.menubar = ewl_hmenubar_new();
    ewl_container_child_append(EWL_CONTAINER(box), eke->gui.ewl.menubar);
    ewl_widget_show(eke->gui.ewl.menubar);

    eke_gui_ewl_menu_setup(eke);

    body = ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(box), body);
    ewl_widget_show(body);

    eke->gui.ewl.notebook = ewl_notebook_new();
    ewl_container_child_append(EWL_CONTAINER(body), eke->gui.ewl.notebook);
    ewl_notebook_tabs_position_set(EWL_NOTEBOOK(eke->gui.ewl.notebook),
                                                        EWL_POSITION_LEFT);
    ewl_notebook_tabs_alignment_set(EWL_NOTEBOOK(eke->gui.ewl.notebook),
                                                        EWL_FLAG_ALIGN_TOP);
    ewl_widget_show(eke->gui.ewl.notebook);

    eke->gui.ewl.statusbar = ewl_statusbar_new();
    ewl_container_child_append(EWL_CONTAINER(box), eke->gui.ewl.statusbar);
    ewl_widget_show(eke->gui.ewl.statusbar);
}
Exemple #8
0
/**
 * popup menu for managing files in the project
 */
static EWL_CALLBACK_DEFN(project_file_menu)
{
	Ewl_Widget *item;
	Ewl_Event_Mouse_Up *ev = ev_data;

	if( file_menu ) {
		ewl_widget_destroy(file_menu);
		file_menu = NULL;
	} else if( ev->button == 3 ) {
		ewl_window_raise(EWL_WINDOW(project_win));

		file_menu = ewl_imenu_new(NULL, "File Options");
		ewl_object_position_request(EWL_OBJECT(file_menu), ev->x, ev->y);
		ewl_object_fill_policy_set(EWL_OBJECT(file_menu), EWL_FLAG_FILL_NONE);
		ewl_container_child_append(EWL_CONTAINER(project_win), file_menu);
		ewl_callback_append(file_menu, EWL_CALLBACK_CONFIGURE,
												project_file_menu_configure, NULL);
		ewl_callback_call(file_menu, EWL_CALLBACK_SELECT);
		ewl_widget_show(file_menu);

		item = ewl_menu_item_new(NULL, "Save");
		/* HACK FOR NON-STRING DATA HASHES */
		item->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
		ewl_widget_data_set(item, "Action", (void *) EWLER_FILE_SAVE);
		ewl_callback_append(item, EWL_CALLBACK_SELECT,
												project_file_menu_cb, user_data);
		ewl_container_child_append(EWL_CONTAINER(file_menu), item);
		ewl_widget_show(item);

		item = ewl_menu_item_new(NULL, "Settings...");
		/* HACK FOR NON-STRING DATA HASHES */
		item->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
		ewl_widget_data_set(item, "Action", (void *) EWLER_FILE_SETTINGS);
		ewl_callback_append(item, EWL_CALLBACK_SELECT,
												project_file_menu_cb, user_data);
		ewl_container_child_append(EWL_CONTAINER(file_menu), item);
		ewl_widget_show(item);

		item = ewl_menu_item_new(NULL, "Delete");
		/* HACK FOR NON-STRING DATA HASHES */
		item->data = ecore_hash_new(ecore_str_hash, ecore_str_compare);
		ewl_widget_data_set(item, "Action", (void *) EWLER_FILE_DELETE);
		ewl_callback_append(item, EWL_CALLBACK_SELECT,
												project_file_menu_cb, user_data);
		ewl_container_child_append(EWL_CONTAINER(file_menu), item);
		ewl_widget_show(item);
	}
}
static int
create_test(Ewl_Container *box)
{
        Ewl_Widget *vbox, *o;
        Ewl_Embed *emb;

        vbox = ewl_vbox_new();
        ewl_container_child_append(box, vbox);
        ewl_widget_show(vbox);

        o = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(o), "button");
        ewl_container_child_append(EWL_CONTAINER(vbox), o);
        ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_widget_cb_click, NULL);
        ewl_widget_show(o);

        emb = ewl_embed_widget_find(EWL_WIDGET(box));
        ewl_window_fullscreen_set(EWL_WINDOW(emb), TRUE);

        return 1;
}
Exemple #10
0
void
ecrin_ewl_window_create (void)
{
  Ewl_Widget *window;
  Ewl_Widget *hbox;
  Ewl_Widget *notebook;
  Ewl_Widget *tab;
  Ewl_Widget *vbox;
  Ewl_Widget *separator;

  /* We order the list */
  sorted_keys = _list_keys_order (ecrin_hash_keys_get ());

  window = ewl_window_new ();
  ewl_object_size_request (EWL_OBJECT (window), 400, 400);
  ewl_window_title_set (EWL_WINDOW (window),
                       "Ecrin");
  ewl_window_name_set (EWL_WINDOW (window), "Ecrin");
  ewl_window_class_set (EWL_WINDOW (window), "Ecrin");
  ewl_callback_append (window, EWL_CALLBACK_DELETE_WINDOW,
                      _main_window_close, NULL);

  hbox = ewl_hbox_new ();
  ewl_container_child_append (EWL_CONTAINER (window), hbox);
  ewl_widget_show (hbox);

  notebook = ewl_notebook_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), notebook);
  ewl_widget_show (notebook);

  tab = ewl_label_new ("EFL package");
  ewl_widget_show (tab);
  
  tree = ewl_tree_new (1);
  ewl_tree_headers_visible_set (EWL_TREE (tree), 0);
  ewl_notebook_page_append (EWL_NOTEBOOK (notebook), tab, tree);
  ewl_widget_show (tree);

  tab = ewl_label_new ("Search");
  ewl_widget_show (tab);

  vbox = ewl_vbox_new ();
  ewl_box_homogeneous_set (EWL_BOX (vbox), 0);
  ewl_notebook_page_append (EWL_NOTEBOOK (notebook), tab, vbox);
  ewl_widget_show (vbox);

  entry = ewl_entry_new ("");
  ewl_object_fill_policy_set(EWL_OBJECT(entry),
                             EWL_FLAG_FILL_VSHRINK | EWL_FLAG_FILL_HFILL);
  ewl_container_child_append (EWL_CONTAINER (vbox), entry);
  ewl_callback_append (entry, EWL_CALLBACK_VALUE_CHANGED, _list_display_cb, NULL);
  ewl_widget_show (entry);

  separator = ewl_hseparator_new ();
  ewl_container_child_append (EWL_CONTAINER (vbox), separator);
  ewl_widget_show (separator);

  list = ewl_tree_new (1);
  ewl_tree_headers_visible_set (EWL_TREE (list), 0);
  ewl_container_child_append (EWL_CONTAINER (vbox), list);
  ewl_widget_show (list);

  separator = ewl_vseparator_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), separator);
  ewl_widget_show (separator);

  text = ewl_text_new ("");
  ewl_container_child_append (EWL_CONTAINER (hbox), text);
  ewl_widget_show (text);

  ecrin_ewl_tree_fill_package ();
  ecrin_ewl_list_fill_package ("");

  ewl_widget_show (window);
}
/*
 * Internal functions
 */
static Ewl_Widget *
help_reader_window_new(void)
{
    Ewl_Widget * win, * c, * w, * vbox;

    win = calloc(1, sizeof(Help_Reader_Window));
    ewl_window_init(EWL_WINDOW(win));
    ewl_object_size_request(EWL_OBJECT(win), 600, 500);
    ewl_window_name_set(EWL_WINDOW(win), "Elitaire Help");
    ewl_window_class_set(EWL_WINDOW(win), "Elitaire");
    ewl_callback_append(win, EWL_CALLBACK_DESTROY,
                        help_reader_window_cb_destroy, NULL);
    ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
                        help_reader_window_cb_delete, NULL);
    ewl_widget_show(win);

    /* vbox to hold the toolbar and the text view */
    vbox = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(win), vbox);
    ewl_widget_show(vbox);

    /* the toolbar */
    c = ewl_htoolbar_new();
    ewl_toolbar_icon_part_hide(EWL_TOOLBAR(c), EWL_ICON_PART_LABEL);
    ewl_container_child_append(EWL_CONTAINER(vbox), c);
    ewl_widget_show(c);

    /* the toolbar buttons */
    w = ewl_icon_simple_new();
    ewl_stock_type_set(EWL_STOCK(w), EWL_STOCK_ARROW_LEFT);
    ewl_callback_append(w, EWL_CALLBACK_CLICKED,
                        help_reader_prev_button_cb_clicked, win);
    ewl_container_child_append(EWL_CONTAINER(c), w);
    ewl_widget_disable(w);
    ewl_widget_show(w);
    HELP_READER_WINDOW(win)->prev_button = w;

    w = ewl_icon_simple_new();
    ewl_stock_type_set(EWL_STOCK(w), EWL_STOCK_ARROW_RIGHT);
    ewl_callback_append(w, EWL_CALLBACK_CLICKED,
                        help_reader_next_button_cb_clicked, win);
    ewl_container_child_append(EWL_CONTAINER(c), w);
    ewl_widget_disable(w);
    ewl_widget_show(w);
    HELP_READER_WINDOW(win)->next_button = w;

    w = ewl_icon_simple_new();
    ewl_stock_type_set(EWL_STOCK(w), EWL_STOCK_HOME);
    ewl_callback_append(w, EWL_CALLBACK_CLICKED,
                        help_reader_home_button_cb_clicked, win);
    ewl_container_child_append(EWL_CONTAINER(c), w);
    ewl_widget_show(w);

    /* the text view */
    c = ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(vbox), c);
    ewl_widget_show(c);

    w = ewl_text_new();
    ewl_container_child_append(EWL_CONTAINER(c), w);
    ewl_widget_show(w);

    HELP_READER_WINDOW(win)->text = w;

    /* the histroy */
    HELP_READER_WINDOW(win)->history = ecore_dlist_new();
    ecore_dlist_free_cb_set(HELP_READER_WINDOW(win)->history, free);

    return win;
}
Exemple #12
0
int
main (int argc, char *argv[])
{
  Ecore_List     *str_data = NULL;
  Ewl_Widget     *window;
  Ewl_Widget     *hbox;
  Ewl_Widget     *list;
  Ewl_Model      *model;
  Ewl_View       *view;
  Ewl_Widget     *dvi;
  Ewl_Widget     *sp;
  const Edvi_Document  *document;
  int             page_count;
  int             i;

  if (argc == 1) {
    printf ("Usage: %s dvi_file\n", argv[0]);
    return EXIT_FAILURE;
  }

  printf ("[DVI] version       : %s\n", edvi_version_get ());
  if (!edvi_init (300, "cx", 4,
                  1.0, 1.0,
                  0, 255, 255, 255, 0, 0, 0))
    return EXIT_FAILURE;

  ewl_init (&argc, (char **)argv);
  str_data = ecore_list_new();
  ecore_list_free_cb_set (str_data, free);

  /* We open the dvi file */
  dvi = ewl_dvi_new ();
  if (!ewl_dvi_file_set (EWL_DVI (dvi), argv[1])) {
    printf ("Can not load the document %s\nExiting...", argv[1]);
    ecore_list_destroy (str_data);
    ewl_main_quit();
    return EXIT_FAILURE;
  }

  window = ewl_window_new ();
  ewl_window_title_set (EWL_WINDOW (window), "Ewl Dvi Test Application");
  ewl_callback_append (window, EWL_CALLBACK_DELETE_WINDOW,
                       _quit_cb, str_data);

  hbox = ewl_hbox_new ();
  ewl_box_homogeneous_set (EWL_BOX (hbox), FALSE);
  ewl_container_child_append (EWL_CONTAINER (window), hbox);
  ewl_widget_show (hbox);

  sp = ewl_scrollpane_new ();
  ewl_container_child_append (EWL_CONTAINER (hbox), sp);
  ewl_widget_show (sp);

  document = ewl_dvi_dvi_document_get (EWL_DVI (dvi));
  page_count = edvi_document_page_count_get (document);
  for (i = 0; i < page_count; i++) {
    char row_text[64];
    char *txt;

    snprintf (row_text, 64, "%d", i + 1);
    txt = strdup (row_text);
    ecore_list_append(str_data, txt);
  }

  model = ewl_model_ecore_list_instance();
  view = ewl_label_view_get();

  list = ewl_list_new ();
  ewl_mvc_model_set(EWL_MVC(list), model);
  ewl_mvc_view_set(EWL_MVC(list), view);
  ewl_mvc_data_set(EWL_MVC(list), str_data);
  ewl_callback_append (list,
                       EWL_CALLBACK_VALUE_CHANGED,
                       EWL_CALLBACK_FUNCTION (_change_page_cb),
                       dvi);
  ewl_container_child_append (EWL_CONTAINER (sp), list);
  ewl_widget_show (list);

  ewl_dvi_mag_set (EWL_DVI (dvi), 0.5);
  ewl_container_child_append (EWL_CONTAINER (hbox), dvi);
  ewl_widget_show (dvi);

  ewl_widget_show (window);

  ewl_main ();

  edvi_shutdown ();

  return EXIT_SUCCESS;
}
/*
 * Parser functions
 */
static void
help_reader_text_cb_append(void *data, const char *text,
                           Eli_Help_Reader_Node *styles, size_t len)
{
    Help_Reader_Window * win = data;
    Ewl_Text * t = EWL_TEXT(win->text);
    size_t i;
    int bold = 0;
    int italic = 0;
    int pref = 0;
    unsigned int size = 12;
    unsigned int r, g, b, a;
    unsigned int t_len;
    unsigned int t_pos;
    r = g = b = 0;
    a = 255;
    const char * url = NULL;

    for (i = 0; i < len; i++)
    {
        switch (styles[i].type)
        {
        case ELI_HELP_READER_NODE_HEADER:
        {
            unsigned int h = 1;
            if (styles[i].parameter)
                h = atoi(styles[i].parameter);
            h--;
            if (h > 5)
                h = 5;

            size = 24 - h * 5;
            bold = 1;
        }
        break;
        case ELI_HELP_READER_NODE_LINK:
            r = 10;
            g = 0;
            b = 255;
            a = 255;
            url = styles[i].parameter;
            break;
        case ELI_HELP_READER_NODE_EMPHASIZE:
            italic = 1;
            break;
        case ELI_HELP_READER_NODE_STRONG:
            bold = 1;
            break;
        case ELI_HELP_READER_NODE_PREFORMATED:
            pref = 1;
            break;
        case ELI_HELP_READER_NODE_TITLE:
            ewl_window_title_set(EWL_WINDOW(win), text);
            return;
        case ELI_HELP_READER_NODE_BLOCK:
        case ELI_HELP_READER_NODE_PARAGRAPH:
        case ELI_HELP_READER_NODE_UNKNOWN:
        default:
            break;
        }
    }

    if (pref)
        ewl_text_font_set(t, "ewl/monospace");
    else if (bold && italic)
        ewl_text_font_set(t, "ewl/default/bold-italic");
    else if (italic)
        ewl_text_font_set(t, "ewl/default/italic");
    else if (bold)
        ewl_text_font_set(t, "ewl/default/bold");
    else
        ewl_text_font_set(t, NULL);

    ewl_text_font_size_set(t, size);
    ewl_text_color_set(t, r, g, b, a);
    t_pos = ewl_text_length_get(t);
    ewl_text_text_append(t, text);
    t_len = ewl_text_length_get(t) - t_pos;

    if (url)
    {
        Ewl_Widget * trig;

        trig = ewl_text_trigger_new(EWL_TEXT_TRIGGER_TYPE_TRIGGER);
        ewl_attach_mouse_cursor_set(trig, EWL_MOUSE_CURSOR_HAND2);
        ewl_text_trigger_start_pos_set(EWL_TEXT_TRIGGER(trig), t_pos);
        ewl_text_trigger_length_set(EWL_TEXT_TRIGGER(trig), t_len);
        ewl_callback_append(trig, EWL_CALLBACK_CLICKED,
                            help_reader_trigger_cb_clicked, win);
        ewl_callback_append(trig, EWL_CALLBACK_DESTROY,
                            help_reader_trigger_cb_destroy, NULL);
        ewl_widget_data_set(trig, TRIGGER_TXT, strdup(url));
        ewl_container_child_append(EWL_CONTAINER(t), trig);
        ewl_widget_show(trig);

    }
}
Exemple #14
0
static void
eke_gui_ewl_add_feed_cb(Ewl_Widget *w, void *ev, void *data)
{
    Eke *eke;
    Ewl_Widget *win, *box, *entry, *o, *name_entry;

    eke = data;

    win = ewl_widget_data_get(w, "manage_feed_win");
    ewl_widget_destroy(win);

    win = ewl_dialog_new(EWL_POSITION_BOTTOM);
    ewl_window_title_set(EWL_WINDOW(win), PACKAGE " -- add feed");
    ewl_window_name_set(EWL_WINDOW(win), PACKAGE);
    ewl_window_class_set(EWL_WINDOW(win), PACKAGE);
    ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
                            eke_gui_ewl_manage_feed_exit_cb, win);
    ewl_widget_show(win);

    box = ewl_vbox_new();
    ewl_dialog_widget_add(EWL_DIALOG(win), box);
    ewl_widget_show(box);

    o = ewl_text_new("Add Feed");
    ewl_container_child_append(EWL_CONTAINER(box), o);
    ewl_widget_show(o);

    o = ewl_text_new(" ");
    ewl_container_child_append(EWL_CONTAINER(box), o);
    ewl_widget_show(o);

    o = ewl_text_new("Feed Name");
    ewl_container_child_append(EWL_CONTAINER(box), o);
    ewl_widget_show(o);

    name_entry = ewl_entry_new("");
    ewl_container_child_append(EWL_CONTAINER(box), name_entry);
    ewl_widget_show(name_entry);

    o = ewl_text_new(" ");
    ewl_container_child_append(EWL_CONTAINER(box), o);
    ewl_widget_show(o);

    o = ewl_text_new("URI [http://<server>[:port]/path/to/file.rss");
    ewl_container_child_append(EWL_CONTAINER(box), o);
    ewl_widget_show(o);

    entry = ewl_entry_new("");
    ewl_container_child_append(EWL_CONTAINER(box), entry);
    ewl_widget_show(entry);
   
    o = ewl_button_stock_with_id_new(EWL_STOCK_OK, EWL_RESPONSE_OK);
    ewl_container_child_append(EWL_CONTAINER(win), o);
    ewl_widget_data_set(o, "entry", entry);
    ewl_widget_data_set(o, "name_entry", name_entry);
    ewl_widget_data_set(o, "win", win);
    ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
                                eke_gui_ewl_add_feed_ok_cb, eke);
    ewl_widget_show(o);

    o = ewl_button_stock_with_id_new(EWL_STOCK_CANCEL, EWL_RESPONSE_CANCEL);
    ewl_container_child_append(EWL_CONTAINER(win), o);
    ewl_widget_data_set(o, "win", win);
    ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED,
                                eke_gui_ewl_manage_feed_exit_cb, win);
    ewl_widget_show(o);

    return;
    ev = NULL;
}
Exemple #15
0
        ewl_callback_append(o, EWL_CALLBACK_CLICKED, ewl_widget_cb_click, NULL);
        ewl_widget_show(o);

        return 1;
}

static void
ewl_widget_cb_click(Ewl_Widget *w, void *ev __UNUSED__, void *data __UNUSED__)
{
        Ewl_Embed *emb;
        Ewl_Widget *win, *vbox, *o;

        emb = ewl_embed_widget_find(w);

        win = ewl_window_new();
        ewl_window_title_set(EWL_WINDOW(win), "MODAL");
        ewl_callback_append(win, EWL_CALLBACK_DELETE_WINDOW,
                                        ewl_widget_cb_close_click, NULL);
        ewl_widget_show(win);

        vbox = ewl_vbox_new();
        ewl_container_child_append(EWL_CONTAINER(win), vbox);
        ewl_widget_show(vbox);

        o = ewl_button_new();
        ewl_button_label_set(EWL_BUTTON(o), "Go modal");
        ewl_callback_append(o, EWL_CALLBACK_CLICKED,
                                        ewl_widget_cb_go_modal, emb);
        ewl_container_child_append(EWL_CONTAINER(vbox), o);
        ewl_widget_show(o);
void
ewl_icon_local_viewer_delete_selected (entropy_gui_component_instance *
				       instance)
{
  Ewl_Iconbox *ib =
    EWL_ICONBOX (((entropy_icon_viewer *) instance->data)->iconbox);
  entropy_icon_viewer *viewer = instance->data;

  Ecore_List *new_file_list = ecore_list_new ();
  Ecore_List *icon_list;
  gui_file *local_file;
  Ewl_Iconbox_Icon *list_item;

  Ewl_Widget *dialog_win;
  Ewl_Widget *dialog_label;
  Ewl_Widget *button;

  /*This is kind of awkward - the first item on the list is
   * the plugin instance reference*/
  ecore_list_append (new_file_list, instance);

  dialog_win = ewl_dialog_new ();
  ewl_window_title_set (EWL_WINDOW (dialog_win), "Delete?");

  ewl_dialog_active_area_set (EWL_DIALOG (dialog_win), EWL_POSITION_TOP);
  dialog_label = ewl_label_new ();
  ewl_label_text_set (EWL_LABEL (dialog_label),
		      "Are you sure you want to delete these files?");
  ewl_container_child_append (EWL_CONTAINER (dialog_win), dialog_label);
  ewl_widget_show (dialog_label);

  ewl_dialog_active_area_set (EWL_DIALOG (dialog_win), EWL_POSITION_BOTTOM);



  //////////////////////
  icon_list = ewl_iconbox_get_selection (EWL_ICONBOX (ib));

  ecore_list_first_goto (icon_list);
  while ((list_item = ecore_list_next (icon_list))) {
    local_file = ecore_hash_get (viewer->icon_hash, list_item);
    if (local_file) {
      entropy_core_file_cache_add_reference (local_file->file->md5);
      ecore_list_append (new_file_list, local_file->file);
    }
  }
  entropy_file_wait_list_add (viewer, new_file_list);
  ecore_list_destroy (icon_list);

  button = ewl_button_new ();
  ewl_button_label_set (EWL_BUTTON (button), "Yes");
  ewl_widget_show (button);
  ewl_container_child_append (EWL_CONTAINER (dialog_win), button);
  ewl_callback_append (button, EWL_CALLBACK_CLICKED,
		       ewl_icon_local_viewer_delete_cb, new_file_list);

  button = ewl_button_new ();
  ewl_button_label_set (EWL_BUTTON (button), "No");
  ewl_widget_show (button);
  ewl_container_child_append (EWL_CONTAINER (dialog_win), button);
  ewl_callback_append (button, EWL_CALLBACK_CLICKED,
		       ewl_icon_local_viewer_delete_cb, new_file_list);

  ewl_widget_show (dialog_win);
}
Exemple #17
0
void
_icon_editor_gui_init()
{
  if (!editor) return;

  editor->win = ewl_window_new();
  ewl_window_title_set(EWL_WINDOW(editor->win), "Iconbar Icon Editor");
  ewl_window_name_set(EWL_WINDOW(editor->win), "Iconbar Icon Editor");
  ewl_callback_append(editor->win, EWL_CALLBACK_DELETE_WINDOW,
                      _editor_close_win, NULL);

  /* boxes */
  editor->main_vbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->win), editor->main_vbox);
  ewl_widget_show(editor->main_vbox);
  
  editor->top_hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->main_vbox), editor->top_hbox);
  ewl_widget_show(editor->top_hbox);

  editor->bot_hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->main_vbox), editor->bot_hbox);
  ewl_widget_show(editor->bot_hbox);

  /* image */
  editor->icon_image = ewl_image_new("test.png", NULL);
  ewl_container_child_append(EWL_CONTAINER(editor->top_hbox), editor->icon_image);
  ewl_object_padding_set(EWL_OBJECT(editor->icon_image), 5, 5, 5, 5);
  ewl_widget_show(editor->icon_image);
  ewl_callback_append(editor->icon_image, EWL_CALLBACK_REALIZE,
                      _editor_realize, NULL);
  ewl_callback_append(editor->icon_image, EWL_CALLBACK_MOUSE_UP,
                      _editor_icon_image_cb, NULL);

  /* vbox for entry hboxes */
  editor->right_vbox = ewl_vbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->top_hbox), editor->right_vbox);
  ewl_widget_show(editor->right_vbox);


  /* name */
  editor->name.hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->right_vbox), editor->name.hbox);
  ewl_widget_show(editor->name.hbox);

  editor->name.label = ewl_text_new("Name: ");
  ewl_container_child_append(EWL_CONTAINER(editor->name.hbox), editor->name.label);
  ewl_widget_show(editor->name.label);

  editor->name.entry = ewl_entry_new("");
  ewl_container_child_append(EWL_CONTAINER(editor->name.hbox), editor->name.entry);
  ewl_widget_show(editor->name.entry);


  /* exec */
  editor->exec.hbox = ewl_hbox_new();
  ewl_container_child_append(EWL_CONTAINER(editor->right_vbox), editor->exec.hbox);
  ewl_widget_show(editor->exec.hbox);

  editor->exec.label = ewl_text_new("Exec:");
  ewl_container_child_append(EWL_CONTAINER(editor->exec.hbox), editor->exec.label);
  ewl_widget_show(editor->exec.label);

  editor->exec.entry = ewl_entry_new("");
  ewl_container_child_append(EWL_CONTAINER(editor->exec.hbox), editor->exec.entry);
  ewl_widget_show(editor->exec.entry);


  /* cancel and save buttons */
  editor->cancel_but = ewl_button_new("Cancel");
  ewl_object_fill_policy_set(EWL_OBJECT(editor->cancel_but), EWL_FLAG_FILL_NONE);
  ewl_object_padding_set(EWL_OBJECT(editor->cancel_but), 5, 5, 5, 5);
  ewl_object_alignment_set(EWL_OBJECT(editor->cancel_but), EWL_FLAG_ALIGN_RIGHT);
  ewl_container_child_append(EWL_CONTAINER(editor->bot_hbox), editor->cancel_but);
  ewl_widget_show(editor->cancel_but);
  ewl_callback_append(editor->cancel_but, EWL_CALLBACK_CLICKED,
                      _editor_button_cb, NULL);

  editor->ok_but = ewl_button_new("Save and Close");
  ewl_object_fill_policy_set(EWL_OBJECT(editor->ok_but), EWL_FLAG_FILL_NONE);
  ewl_object_padding_set(EWL_OBJECT(editor->ok_but), 5, 5, 5, 5);
  ewl_object_alignment_set(EWL_OBJECT(editor->ok_but), EWL_FLAG_ALIGN_RIGHT);
  ewl_container_child_append(EWL_CONTAINER(editor->bot_hbox), editor->ok_but);
  ewl_widget_show(editor->ok_but);
  ewl_callback_append(editor->ok_but, EWL_CALLBACK_CLICKED,
                      _editor_button_cb, NULL);

  editor->filesel.win = ewl_window_new();

  editor->filesel.dialog = ewl_filedialog_new(EWL_FILEDIALOG_TYPE_OPEN);
  ewl_container_child_append(EWL_CONTAINER(editor->filesel.win), editor->filesel.dialog);
  ewl_widget_show(editor->filesel.dialog);
  ewl_callback_append(editor->filesel.dialog, EWL_CALLBACK_VALUE_CHANGED, _editor_filesel_cb, NULL);
}
Exemple #18
0
/**
 * initialize this project manager.  called from main
 */
int
projects_init( char *filename )
{
	Ewl_Widget *vbox, *menu, *project_menu, *settings_menu, *windows_menu, *item;

	/* ui phase... kick on some phat window action */
	project_win = ewl_window_new();
	ewl_window_title_set(EWL_WINDOW(project_win), "Ewler");
	ewl_object_size_request(EWL_OBJECT(project_win), 200, 320);
	ewl_callback_append(project_win, EWL_CALLBACK_DELETE_WINDOW,
											project_exit, NULL);
	ewl_callback_append(project_win, EWL_CALLBACK_KEY_DOWN,
											project_key_down, NULL);

	vbox = ewl_vbox_new();
	ewl_container_child_append(EWL_CONTAINER(project_win), vbox);

	menu = ewl_hmenubar_new();
	ewl_container_child_append(EWL_CONTAINER(vbox), menu);

	project_menu = ewl_menubar_menu_add(EWL_MENUBAR(menu), NULL, "Project");

	item = ewl_menu_item_new(NULL, "New");
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_widget_show(item);

	item = ewl_menu_item_new(NULL, "New Form");
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_callback_append(item, EWL_CALLBACK_CLICKED, form_new, NULL);
	ewl_widget_show(item);

	item = ewl_menu_item_new(NULL, "Open...");
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_callback_append(item, EWL_CALLBACK_CLICKED, open, NULL);
	ewl_widget_show(item);

	item = ewl_menu_separator_new();
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_widget_show(item);

	item = ewl_menu_item_new(NULL, "Save");
	ewl_callback_append(item, EWL_CALLBACK_CLICKED, save, NULL);
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_widget_show(item);

	item = ewl_menu_separator_new();
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_widget_show(item);

	item = ewl_menu_item_new(NULL, "Exit");
	ewl_callback_append(item, EWL_CALLBACK_CLICKED,
											project_exit, NULL);
	ewl_container_child_append(EWL_CONTAINER(project_menu), item);
	ewl_widget_show(item);

	ewl_widget_show(project_menu);

	settings_menu = ewl_menubar_menu_add(EWL_MENUBAR(menu), NULL, "Settings");

	item = ewl_menu_item_new(NULL, "Options...");
	ewl_container_child_append(EWL_CONTAINER(settings_menu), item);
	ewl_callback_append(item, EWL_CALLBACK_CLICKED,
											options, NULL);
	ewl_widget_show(item);

	ewl_widget_show(settings_menu);

	windows_menu = ewl_menubar_menu_add(EWL_MENUBAR(menu), NULL, "Windows");

	item = ewl_menu_item_new(NULL, "Toolbar");
	ewl_container_child_append(EWL_CONTAINER(windows_menu), item);
	ewl_callback_append(item, EWL_CALLBACK_CLICKED, tools_toggle, NULL);
	ewl_widget_show(item);

	item = ewl_menu_item_new(NULL, "Inspector");
	ewl_container_child_append(EWL_CONTAINER(windows_menu), item);
	ewl_callback_append(item, EWL_CALLBACK_CLICKED, inspector_toggle, NULL);
	ewl_widget_show(item);

	item = ewl_menu_item_new(NULL, "Callbacks");
	ewl_container_child_append(EWL_CONTAINER(windows_menu), item);
	ewl_callback_append(item, EWL_CALLBACK_CLICKED, callbacks_toggle, NULL);
	ewl_widget_show(item);

	ewl_widget_show(windows_menu);

	ewl_widget_show(menu);

	file_tree = ewl_tree_new(1);
	ewl_tree_mode_set(EWL_TREE(file_tree), EWL_TREE_MODE_SINGLE);
	ewl_container_child_append(EWL_CONTAINER(vbox), file_tree);
	ewl_widget_show(file_tree);

	ewl_widget_show(vbox);
	ewl_widget_show(project_win);
	/* end ui phase */

	/* project phase */
	active_project = NEW(Ewler_Project);
	if( !active_project ) {
		ewler_error("projects_init: out of memory!");
		return -1;
	}
	active_project->files = ecore_hash_new(ecore_str_hash, ecore_str_compare);
	ecore_hash_free_key_cb_set(active_project->files, free);
	ecore_hash_free_value_cb_set(active_project->files, free);

	if( !filename || project_open(filename) < 0 ) {
		project_new();
	}
	/* end project phase */

	return 0;
}
void entropy_ewl_mime_dialog_display() {
	Ewl_Widget* window = ewl_window_new();
	Ewl_Widget* box = ewl_vbox_new();
	Ewl_Widget* button = ewl_button_new();
	Ewl_Widget* hbox;
	
	entropy_core* core = entropy_core_get_core();
	char* entries[3];
	char* key;
	entropy_mime_action* action;
	Ecore_List* keys;

	last_select_text = NULL;


	/*Init the mime tree*/
	mime_tree = ewl_tree_new(2);

	ewl_tree_mode_set(EWL_TREE(mime_tree), EWL_SELECTION_MODE_SINGLE);
	ewl_object_minimum_size_set(EWL_OBJECT(window), 530, 400);
	ewl_window_title_set(EWL_WINDOW(window), "Edit MIME Actions..");
	ewl_container_child_append(EWL_CONTAINER(window), box);
	ewl_container_child_append(EWL_CONTAINER(box), mime_tree);
	
	ewl_widget_show(box);

	keys = ecore_hash_keys(core->mime_action_hint);
	while ((key = ecore_list_first_remove(keys))) {
		Ewl_Widget* row;
		
		entries[0] = key;
		entries[1] = ((entropy_mime_action*)ecore_hash_get(core->mime_action_hint, key))->executable;
		entries[2] = NULL;

		row = ewl_tree_text_row_add(EWL_TREE(mime_tree), NULL,entries);
		ewl_widget_color_set(row,0,0,0,255);
		ewl_callback_append(row, EWL_CALLBACK_MOUSE_DOWN, 
			mime_row_click_cb, key);
	}
	ecore_list_destroy(keys);


	hbox = ewl_hbox_new();
	ewl_container_child_append(EWL_CONTAINER(box), hbox);
	ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_SHRINK);
	ewl_widget_show(hbox);


	/*Add Button*/
	ewl_button_label_set(EWL_BUTTON(button), "Add MIME Action");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, entropy_ewl_mime_add_display_cb, NULL);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	
	/*OK Button*/
	button = ewl_button_new();
	ewl_button_label_set(EWL_BUTTON(button), "Close");
	ewl_object_maximum_h_set(EWL_OBJECT(button), 15);
	ewl_callback_append(button, EWL_CALLBACK_CLICKED, window_dismiss_cb, window);
	ewl_container_child_append(EWL_CONTAINER(hbox), button);
	ewl_widget_show(button);

	
	
	
	ewl_widget_show(window);
	ewl_widget_show(mime_tree);
	
}
Exemple #20
0
int main ( int argc, char ** argv )
{	

    
    Ewl_Widget *vbox=NULL;
    Ewl_Widget *statbar=NULL;
    char *homedir;
    char *configfile;
    if(argc<2)
        return 1;
    
    if ( !ewl_init ( &argc, argv ) )
    {
        return 1;
    }

    //setlocale(LC_ALL, "");
    //textdomain("elementpdf");
    ewl_theme_theme_set(get_theme_file());
    
    homedir=getenv("HOME");
    configfile=(char *)calloc(strlen(homedir)+21 + 1, sizeof(char));
    strcat(configfile,homedir);
    strcat(configfile,"/.madpdf");
    
    if(!file_exists(configfile))
    {
        mkdir (configfile,S_IRUSR|S_IWUSR|S_IXUSR|S_IRGRP|S_IXGRP|S_IROTH|S_IXOTH);
        
    }
    
    strcat(configfile,"/settings.xml");
    
    
    
    load_settings(configfile);
    
    win = ewl_window_new();
    ewl_window_title_set ( EWL_WINDOW ( win ), "EWL_WINDOW" );
    ewl_window_name_set ( EWL_WINDOW ( win ), "EWL_WINDOW" );
    ewl_window_class_set ( EWL_WINDOW ( win ), "EWLWindow" );
    ewl_object_size_request ( EWL_OBJECT ( win ), 600, 800 );
    ewl_callback_append ( win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb, NULL );
    ewl_callback_append(win, EWL_CALLBACK_KEY_DOWN, cb_key_down, NULL);
    ewl_widget_name_set(win,"mainwindow");
    ewl_widget_show ( win );
 
    vbox=ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(win),vbox);
    ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_FILL);
    ewl_widget_show(vbox);
    
    scrollpane=ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(vbox),scrollpane);
    ewl_callback_append(scrollpane,EWL_CALLBACK_REVEAL,cb_scrollpane_revealed,NULL);
    ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(scrollpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(scrollpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    //ewl_object_fill_policy_set(EWL_OBJECT(scrollpane), EWL_FLAG_FILL_FILL);
    //ewl_theme_data_str_set(EWL_WIDGET(scrollpane),"/scrollpane/group","ewl/blank");
    ewl_widget_show(scrollpane);
    
    trimpane=ewl_scrollpane_new();
    ewl_container_child_append(EWL_CONTAINER(scrollpane),trimpane);
    ewl_object_alignment_set(EWL_OBJECT(trimpane),EWL_FLAG_ALIGN_LEFT|EWL_FLAG_ALIGN_TOP);
    ewl_scrollpane_hscrollbar_flag_set(EWL_SCROLLPANE(trimpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    ewl_scrollpane_vscrollbar_flag_set(EWL_SCROLLPANE(trimpane),EWL_SCROLLPANE_FLAG_ALWAYS_HIDDEN);
    //ewl_theme_data_str_set(EWL_WIDGET(trimpane),"/scrollpane/group","ewl/blank");
    ewl_widget_show(trimpane);
    
    statbar=ewl_hbox_new();
    ewl_container_child_append(EWL_CONTAINER(vbox),statbar);
    ewl_theme_data_str_set(EWL_WIDGET(statbar),"/hbox/group","ewl/menu/oi_menu");
    ewl_object_fill_policy_set(EWL_OBJECT(statbar),EWL_FLAG_FILL_HFILL|EWL_FLAG_FILL_VSHRINKABLE);
    ewl_widget_show(statbar);
    
    statlabel1=ewl_label_new();   
    //ewl_statusbar_left_append(EWL_STATUSBAR(statbar),statlabel1);
    ewl_container_child_append(EWL_CONTAINER(statbar),statlabel1);
    ewl_theme_data_str_set(EWL_WIDGET(statlabel1),"/label/group","ewl/oi_statbar_label_left");
    ewl_theme_data_str_set(EWL_WIDGET(statlabel1),"/label/textpart","ewl/oi_statbar_label_left/text");
    ewl_object_fill_policy_set(EWL_OBJECT(statlabel1),EWL_FLAG_FILL_HSHRINKABLE);
    ewl_widget_show(statlabel1);
    
    statlabel2=ewl_label_new();   
    //ewl_statusbar_right_append(EWL_STATUSBAR(statbar),statlabel2);
    ewl_container_child_append(EWL_CONTAINER(statbar),statlabel2);
    ewl_theme_data_str_set(EWL_WIDGET(statlabel2),"/label/group","ewl/oi_statbar_label_right");
    ewl_theme_data_str_set(EWL_WIDGET(statlabel2),"/label/textpart","ewl/oi_statbar_label_right/text");
    ewl_object_fill_policy_set(EWL_OBJECT(statlabel2),EWL_FLAG_FILL_HFILL);
    ewl_widget_show(statlabel2);
    
    
    pdfwidget = ewl_pdf_new();
    ewl_pdf_file_set (EWL_PDF (pdfwidget), argv[1]);
    ewl_container_child_append(EWL_CONTAINER(trimpane),pdfwidget);
    ewl_object_alignment_set(EWL_OBJECT(pdfwidget),EWL_FLAG_ALIGN_LEFT|EWL_FLAG_ALIGN_TOP);
    ewl_widget_name_set(pdfwidget,"pdfwidget");
    ewl_callback_append (pdfwidget, EWL_CALLBACK_CONFIGURE, cb_pdfwidget_resized, NULL );
    ewl_widget_show (pdfwidget);
    
    //set up menu
    menu=ewl_context_menu_new();
    
    ewl_callback_append(menu, EWL_CALLBACK_KEY_DOWN, cb_menu_key_down, NULL);
    ewl_theme_data_str_set(EWL_WIDGET(menu),"/menu/group","ewl/menu/oi_menu");
    ewl_context_menu_attach(EWL_CONTEXT_MENU(menu), statbar);
    
    Ewl_Widget *temp=ewl_menu_new();
    ewl_container_child_append(EWL_CONTAINER(menu),temp);
    ewl_widget_name_set(temp,"menuitem1");
    ewl_button_label_set(EWL_BUTTON(temp),"1. Go to page...");
    ewl_widget_show(temp);

    goto_entry=ewl_entry_new();
    ewl_container_child_append(EWL_CONTAINER(temp),goto_entry);
    ewl_object_custom_w_set(EWL_OBJECT(goto_entry),50);
    ewl_callback_append(goto_entry, EWL_CALLBACK_KEY_DOWN, cb_goto_key_down, NULL);
    ewl_widget_show(goto_entry);
    
    
    temp=ewl_menu_item_new();
    ewl_widget_name_set(temp,"menuitem2");
    ewl_container_child_append(EWL_CONTAINER(menu),temp);
    ewl_button_label_set(EWL_BUTTON(temp),"2. Preferences...");
    ewl_widget_show(temp);

        
    
    
    ewl_main();
    save_settings(configfile);
    free(configfile);
    free_settings();
    return 0;
}
void ewl_frontend_dialog_config_open(Eli_App * eap)
{
    Ewl_Widget * o;
    Ewl_Widget * border_box;
    Ewl_Widget * hbox;
    Ewl_Widget * vbox;
    Ewl_Widget * main_box;
    Ewl_Widget * radio_b[2];

    /* one open config dialog should be enough */
    if (conf_win) return;
    /* Setup and show the configuration window */
    conf_win = ewl_dialog_new();
    ewl_dialog_action_position_set(EWL_DIALOG(conf_win), EWL_POSITION_BOTTOM);
    ewl_window_title_set(EWL_WINDOW(conf_win), _("Configuration"));
    ewl_window_name_set(EWL_WINDOW(conf_win), "Elitaire");
    ewl_window_class_set(EWL_WINDOW(conf_win), "Elitaire");
    ewl_window_leader_foreign_set(EWL_WINDOW(conf_win),
		    		EWL_EMBED_WINDOW(eap->main_win));
    ewl_callback_append(conf_win, EWL_CALLBACK_DELETE_WINDOW, destroy_cb,
                        NULL);
    ewl_dialog_has_separator_set(EWL_DIALOG(conf_win), 1);
    ewl_object_fill_policy_set(EWL_OBJECT(conf_win), EWL_FLAG_FILL_NONE);
    ewl_widget_show(conf_win);
    
    /* the main_box contain the border_boxes */
    ewl_dialog_active_area_set(EWL_DIALOG(conf_win), EWL_POSITION_TOP);
    main_box = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(conf_win), main_box);
    ewl_object_fill_policy_set(EWL_OBJECT(main_box), EWL_FLAG_ALIGN_CENTER);
    ewl_widget_show(main_box);

    /* Setup and show the stock icons */
    ewl_dialog_active_area_set(EWL_DIALOG(conf_win), EWL_POSITION_BOTTOM);

    o = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_CANCEL);
    ewl_container_child_append(EWL_CONTAINER(conf_win), o);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, conf_win_clicked_cb,
                        conf_win);
    ewl_widget_show(o);

    o = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_APPLY);
    ewl_container_child_append(EWL_CONTAINER(conf_win), o);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, conf_win_clicked_cb,
                        conf_win);
    ewl_widget_show(o);

    o = ewl_button_new();
    ewl_stock_type_set(EWL_STOCK(o), EWL_STOCK_OK);
    ewl_container_child_append(EWL_CONTAINER(conf_win), o);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, conf_win_clicked_cb,
                        conf_win);
    ewl_widget_show(o);

    /* *** Graphic Box *** */
    /* Setup and show the border box */
    border_box = ewl_border_new();
    ewl_border_label_set(EWL_BORDER(border_box), _("Graphic"));
    ewl_container_child_append(EWL_CONTAINER(main_box), border_box);
    //ewl_object_fill_policy_set(EWL_OBJECT(border_box), EWL_FLAG_FILL_HFILL);
    ewl_widget_show(border_box);

    /* Setup and show the checkbuttons */
    o = ewl_checkbutton_new();
    ewl_button_label_set(EWL_BUTTON(o), _("animated movements"));
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);
    config.animations = ecore_config_boolean_get("/graphic/animations");
    ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(o), config.animations);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, _check_selected, NULL);

    o = ewl_checkbutton_new();
    ewl_button_label_set(EWL_BUTTON(o), _("shadows"));
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);
    config.shadows = ecore_config_boolean_get("/graphic/shadows");
    ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(o), config.shadows);
    ewl_callback_append(o, EWL_CALLBACK_CLICKED, _check_selected, NULL);

    /* Setup and show the velocity label and seeker */
    hbox = ewl_grid_new();
    ewl_container_child_append(EWL_CONTAINER(border_box), hbox);
    ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_FILL);
    ewl_grid_column_preferred_w_use(EWL_GRID(hbox), 1);
    ewl_widget_show(hbox);

    o = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(o), _("velocity:"));
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);

    o = ewl_label_new();
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_widget_show(o);
    config.vel_label = o;

    o = ewl_hseeker_new();
    config.velocity = ecore_config_int_get("velocity");
    ewl_range_minimum_value_set(EWL_RANGE(o), 200.0);
    ewl_range_maximum_value_set(EWL_RANGE(o), 800.0);
    ewl_range_step_set(EWL_RANGE(o), 60.0);
    ewl_range_value_set(EWL_RANGE(o), (double) config.velocity);
    ewl_widget_name_set(o, "velocity");
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, _hseeker_cb, NULL);
                          _hseeker_cb(o, NULL, NULL);
    ewl_widget_show(o);

    /* Setup and show the frame_rate label and seeker */
    hbox = ewl_grid_new();
    ewl_container_child_append(EWL_CONTAINER(border_box), hbox);
    ewl_object_fill_policy_set(EWL_OBJECT(hbox), EWL_FLAG_FILL_ALL);
    ewl_grid_column_preferred_w_use(EWL_GRID(hbox), 1);
    ewl_widget_show(hbox);

    o = ewl_label_new();
    ewl_label_text_set(EWL_LABEL(o), _("frame rate:"));
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_object_alignment_set(EWL_OBJECT(o), EWL_FLAG_ALIGN_LEFT);
    ewl_widget_show(o);
    
    o = ewl_label_new();
    ewl_container_child_append(EWL_CONTAINER(hbox), o);
    ewl_object_fill_policy_set(EWL_OBJECT(o), EWL_FLAG_FILL_NONE);
    ewl_widget_show(o);
    config.frt_label = o;

    o = ewl_hseeker_new();
    config.frame_rate = ecore_config_int_get("frame_rate");
    ewl_range_minimum_value_set(EWL_RANGE(o), 10.0);
    ewl_range_maximum_value_set(EWL_RANGE(o), 100.0);
    ewl_range_step_set(EWL_RANGE(o), 10.0);
    ewl_range_value_set(EWL_RANGE(o), (double) config.frame_rate);
    ewl_widget_name_set(o, "frame_rate");
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_callback_append(o, EWL_CALLBACK_VALUE_CHANGED, _hseeker_cb, NULL);
    _hseeker_cb(o, NULL, NULL);
    ewl_widget_show(o);

    /* *** Lazy Box *** */
    vbox = ewl_vbox_new();
    ewl_container_child_append(EWL_CONTAINER(main_box), vbox);
    ewl_object_fill_policy_set(EWL_OBJECT(vbox), EWL_FLAG_FILL_NORMAL);
    ewl_widget_show(vbox);

    border_box = ewl_border_new();
    ewl_container_child_append(EWL_CONTAINER(vbox), border_box);
    ewl_border_label_set(EWL_BORDER(border_box), _("Laziness"));
    ewl_widget_show(border_box);
    /* the radio buttons */
    config.lazy = ecore_config_int_get("lazy");
    radio_b[0] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[0]), _("normal mode"));
    ewl_object_alignment_set(EWL_OBJECT(radio_b[0]), EWL_FLAG_ALIGN_LEFT);
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[0]);
    ewl_callback_append(radio_b[0], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[0]);

    radio_b[1] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[1]), _("lazy mode"));
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[1]);
    ewl_object_alignment_set(EWL_OBJECT(radio_b[1]), EWL_FLAG_ALIGN_LEFT);
    ewl_radiobutton_chain_set(EWL_RADIOBUTTON(radio_b[1]),
                              EWL_RADIOBUTTON(radio_b[0]));
    ewl_callback_append(radio_b[1], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[1]);
    if (config.lazy)
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[1]), 1);
    else
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[0]), 1);

    /* *** Render Box *** */
    /* Setup and show the border box */
    border_box = ewl_border_new();
    ewl_border_label_set(EWL_BORDER(border_box), _("Render Engine"));
    ewl_container_child_append(EWL_CONTAINER(vbox), border_box);
    ewl_object_fill_policy_set(EWL_OBJECT(border_box), EWL_FLAG_FILL_FILL);
    ewl_object_alignment_set(EWL_OBJECT(border_box), EWL_FLAG_ALIGN_CENTER);
    ewl_object_alignment_set(EWL_OBJECT(main_box), EWL_FLAG_ALIGN_TOP);
    ewl_widget_show(border_box);

    o = ewl_text_new();
    ewl_text_text_set(EWL_TEXT(o), _("Changes only affect after new start"));
    ewl_container_child_append(EWL_CONTAINER(border_box), o);
    ewl_widget_show(o);

    /* the radio buttons */
    config.gl = ecore_config_boolean_get("/graphic/gl");
    radio_b[0] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[0]), _("Software"));
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[0]);
    ewl_object_alignment_set(EWL_OBJECT(radio_b[0]), EWL_FLAG_ALIGN_LEFT);
    ewl_callback_append(radio_b[0], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[0]);

    radio_b[1] = ewl_radiobutton_new();
    ewl_button_label_set(EWL_BUTTON(radio_b[1]), _("OpenGL (testing)"));
    ewl_container_child_append(EWL_CONTAINER(border_box), radio_b[1]);
    ewl_object_alignment_set(EWL_OBJECT(radio_b[1]), EWL_FLAG_ALIGN_LEFT);
    ewl_radiobutton_chain_set(EWL_RADIOBUTTON(radio_b[1]),
                              EWL_RADIOBUTTON(radio_b[0]));
    ewl_callback_append(radio_b[1], EWL_CALLBACK_CLICKED, _check_selected,
                        NULL);
    ewl_widget_show(radio_b[1]);
    if (config.gl)
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[1]), 1);
    else
        ewl_togglebutton_checked_set(EWL_TOGGLEBUTTON(radio_b[0]), 1);

}