Ejemplo n.º 1
0
/**
 * @brief Sets the submenu of the menu-item: the submenu will be popped up when the menu-item is selected
 * @param menu_item a menu-item
 * @param submenu the submenu to attach to the menu-item
 */
void etk_menu_item_submenu_set(Etk_Menu_Item *menu_item, Etk_Menu *submenu)
{
   if (!menu_item || menu_item->submenu == submenu)
      return;

   if (menu_item->submenu)
   {
      menu_item->submenu->parent_item = NULL;
      etk_object_notify(ETK_OBJECT(menu_item->submenu), "parent-item");
   }
   menu_item->submenu = submenu;
   if (menu_item->submenu)
   {
      menu_item->submenu->parent_item = menu_item;
      etk_object_notify(ETK_OBJECT(menu_item->submenu), "parent-item");
   }

   if (menu_item->submenu)
      etk_widget_theme_signal_emit(ETK_WIDGET(menu_item), "etk,action,show,arrow", ETK_TRUE);
   else
      etk_widget_theme_signal_emit(ETK_WIDGET(menu_item), "etk,action,hide,arrow", ETK_TRUE);

   etk_widget_size_recalc_queue(ETK_WIDGET(menu_item));
   etk_object_notify(ETK_OBJECT(menu_item), "submenu");
}
Ejemplo n.º 2
0
boot_panel* bootpanel_create(main_window *win)
{
    boot_panel* pnl;
    Etk_Widget *scroll,*vbox, *hbox,*text,*frame;

    pnl = malloc(sizeof(boot_panel));
    pnl->win = win;

    vbox = etk_vbox_new(ETK_FALSE, 5);
    hbox = etk_hbox_new(ETK_FALSE, 5);

    pnl->frame = hbox;
    etk_box_append(ETK_BOX(hbox), vbox, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

    scroll = etk_scrolled_view_new ();
    etk_box_append(ETK_BOX(vbox), scroll, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
    etk_widget_show(scroll);

    pnl->eth_list = etk_tree_new();
    pnl->eth_col0 = etk_tree_col_new(ETK_TREE(pnl->eth_list), _("Interfaces"), 80, 0.0);
    etk_tree_col_model_add(pnl->eth_col0, etk_tree_model_checkbox_new());
    etk_tree_col_model_add(pnl->eth_col0, etk_tree_model_text_new());

    etk_signal_connect_by_code(ETK_TREE_COL_CELL_VALUE_CHANGED_SIGNAL,
            ETK_OBJECT(pnl->eth_col0),
            ETK_CALLBACK(bootpanel_ethlist_checkbox_change_cb), pnl);

    etk_tree_mode_set(ETK_TREE(pnl->eth_list), ETK_TREE_MODE_LIST);
    etk_tree_build(ETK_TREE(pnl->eth_list));
    etk_container_add(ETK_CONTAINER(scroll), pnl->eth_list);

    text = etk_text_view_new();
    etk_widget_size_request_set(text, -1, 150);
    etk_object_properties_set(ETK_OBJECT(text), "focusable", ETK_FALSE, NULL);
    etk_textblock_text_set(ETK_TEXT_VIEW(text)->textblock,
            _("<p align=\"center\"><style effect=glow color1=#fa14 color2=#fe87><b>Help!</b></style>"
                "\n<p>When your computer boot, exalt starts and configure yours networks interfaces in the background. If you use the DHCP, your interface will get a IP address after a while.</p>"
                "\n<p>You can have a problem if you use a daemon as nfs-client. If the daemon need a network connection when it starts and your interface has no IP address, the daemon will not work. To avoid this problem Exalt can configure your interface in the foreground. If you select the interface in the list, Exalt will wait until your interface gets a IP address.</p>"
                "\n<p>If the interface doesn't get a IP address before the timeout, your computer will continue the boot process.</p>"
             ),
            ETK_TRUE);
    etk_box_append(ETK_BOX(hbox), text, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);


    frame=etk_frame_new(_("Timeout"));
    etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_FILL, 0);

    hbox = etk_hbox_new(ETK_FALSE, 5);
    etk_container_add(ETK_CONTAINER(frame), hbox);

    pnl->slider = etk_hslider_new(1,60,30,1,5);
    etk_box_append(ETK_BOX(hbox), pnl->slider, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
    etk_slider_label_set(ETK_SLIDER(pnl->slider), "%.0f");
    etk_signal_connect_by_code(ETK_RANGE_VALUE_CHANGED_SIGNAL, ETK_OBJECT(pnl->slider), ETK_CALLBACK(bootpanel_slider_value_changed_cb), pnl);
    etk_slider_update_policy_set(ETK_SLIDER(pnl->slider), ETK_SLIDER_DELAYED);

    bootpanel_update_timeout(pnl);

    return pnl;
}
Ejemplo n.º 3
0
/* Initializes the default values of the spinner */
static void _etk_spinner_constructor(Etk_Spinner *spinner)
{
   if (!spinner)
      return;

   spinner->digits = 0;
   strcpy(spinner->value_format, "%.0f");
   spinner->snap_to_ticks = ETK_FALSE;
   spinner->wrap = ETK_FALSE;
   spinner->step_timer = NULL;
   spinner->successive_steps = 0;
   spinner->editable_object = NULL;
   spinner->selection_dragging = ETK_FALSE;

   ETK_RANGE(spinner)->value_changed_handler = _etk_spinner_value_changed_handler;
   ETK_WIDGET(spinner)->size_allocate = _etk_spinner_size_allocate;

   etk_signal_connect_by_code(ETK_WIDGET_REALIZED_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_realized_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_UNREALIZED_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_unrealized_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_KEY_DOWN_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_key_down_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_KEY_UP_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_key_up_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_FOCUSED_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_focused_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_UNFOCUSED_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_unfocused_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_ENABLED_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_enabled_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_DISABLED_SIGNAL, ETK_OBJECT(spinner), ETK_CALLBACK(_etk_spinner_disabled_cb), NULL);
   etk_signal_connect_by_code(ETK_WIDGET_SELECTION_RECEIVED_SIGNAL, ETK_OBJECT(spinner),
         ETK_CALLBACK(_etk_spinner_selection_received_cb), NULL);
   etk_object_notification_callback_add(ETK_OBJECT(spinner), "step-increment",
         _etk_spinner_step_increment_changed_cb, NULL);
}
Ejemplo n.º 4
0
/* Behavior of the "active_set" function for a radio menu item */
static void _etk_menu_item_radio_active_set(Etk_Menu_Item_Check *check_item, Etk_Bool active)
{
   Etk_Menu_Item_Radio *radio_item;
   Etk_Menu_Item_Check *ci;
   Eina_List *l;

   if (!(radio_item = ETK_MENU_ITEM_RADIO(check_item)) || check_item->active == active)
      return;

   if (!check_item->active || (check_item->active && radio_item->can_uncheck))
   {
      check_item->active = active;
      etk_signal_emit(ETK_MENU_ITEM_CHECK_TOGGLED_SIGNAL, ETK_OBJECT(check_item));
      etk_object_notify(ETK_OBJECT(check_item), "active");

      if (check_item->active)
      {
         /* Uncheck the previously checked item of the group */
         for (l = *radio_item->group; l; l = l->next)
         {
            ci = ETK_MENU_ITEM_CHECK(l->data);
            if (ci != check_item && ci->active)
            {
               ETK_MENU_ITEM_RADIO(ci)->can_uncheck = ETK_TRUE;
               etk_menu_item_check_active_set(ci, ETK_FALSE);
            }
         }
      }
      radio_item->can_uncheck = ETK_FALSE;
   }
}
Ejemplo n.º 5
0
/* This function is called when the radio-button is turned on: it deactivates all
 * the other radio-buttons of the group, and activate the given radio-button */
static void _etk_radio_button_active_set(Etk_Toggle_Button *toggle_button, Etk_Bool active)
{
   Etk_Radio_Button *radio_button;
   Etk_Toggle_Button *tb;
   Eina_List *l;

   if (!(radio_button = ETK_RADIO_BUTTON(toggle_button)) || toggle_button->active == active)
      return;

   if (!toggle_button->active || (toggle_button->active && radio_button->can_uncheck))
   {
      toggle_button->active = active;
      etk_signal_emit(ETK_TOGGLE_BUTTON_TOGGLED_SIGNAL, ETK_OBJECT(toggle_button));
      etk_object_notify(ETK_OBJECT(toggle_button), "active");

      if (toggle_button->active)
      {
         /* Deactivate the current active button of the group */
         for (l = *radio_button->group; l; l = l->next)
         {
            tb = ETK_TOGGLE_BUTTON(l->data);
            if (tb != toggle_button && tb->active)
            {
               ETK_RADIO_BUTTON(tb)->can_uncheck = ETK_TRUE;
               etk_toggle_button_active_set(tb, ETK_FALSE);
            }
         }
      }
      radio_button->can_uncheck = ETK_FALSE;
   }
}
Ejemplo n.º 6
0
/* Removes the child from the box */
static void _etk_box_child_remove(Etk_Container *container, Etk_Widget *widget)
{
   Etk_Box *box;
   Etk_Box_Cell *cell;

   if (!(box = ETK_BOX(container)) || !widget)
      return;

   if ((cell = _etk_box_cell_get(widget)))
   {
      if (cell->prev)
         cell->prev->next = cell->next;
      if (cell->next)
         cell->next->prev = cell->prev;
      if (cell == box->first_cell[cell->group])
         box->first_cell[cell->group] = cell->next;
      if (cell == box->last_cell[cell->group])
         box->last_cell[cell->group] = cell->prev;
      box->cells_count[cell->group]--;

      ETK_WIDGET(box)->focus_order = eina_list_remove_list(ETK_WIDGET(box)->focus_order, cell->focus_node);
      etk_object_data_set(ETK_OBJECT(widget), "_Etk_Box::Cell", NULL);
      free(cell);

      etk_widget_size_recalc_queue(ETK_WIDGET(box));
      etk_signal_emit(ETK_CONTAINER_CHILD_REMOVED_SIGNAL, ETK_OBJECT(box), widget);
   }
}
Ejemplo n.º 7
0
static void
_emphasis_init_player_small(Emphasis_Player_Gui *player)
{
  Etk_Widget *wid;

  /* controls */
  wid = etk_window_new();
  etk_window_wmclass_set(ETK_WINDOW(wid),
                         "emphasis controls", "Emphasis");
  etk_window_title_set(ETK_WINDOW(wid), "Controls");
  etk_window_resize(ETK_WINDOW(wid), 10, 180);
  etk_widget_hide(wid);
  etk_signal_connect("delete-event", ETK_OBJECT(wid),
                     ETK_CALLBACK(cb_pack_quit), player);
  //etk_signal_connect_after("delete-event", ETK_OBJECT(wid),
  //                         ETK_CALLBACK(etk_main_quit), NULL);
  player->small.ctr.window = wid;
  
  /* controls */
  wid = etk_window_new();
  etk_window_wmclass_set(ETK_WINDOW(wid),
                         "emphasis cover", "Emphasis");
  etk_window_title_set(ETK_WINDOW(wid), "Cover");
  etk_window_resize(ETK_WINDOW(wid), 180, 180);
  etk_widget_hide(wid);
  etk_signal_connect("delete-event", ETK_OBJECT(wid),
                     ETK_CALLBACK(cb_pack_quit), player);
  //etk_signal_connect_after("delete-event", ETK_OBJECT(wid),
  //                         ETK_CALLBACK(etk_main_quit), NULL);
  player->small.cov.window = wid;

  player->small.packed = ETK_TRUE;
}
Ejemplo n.º 8
0
void
gradient_spectra_combo_populate(void)
{
   Eina_List *spectrums, *l;
   Etk_Widget *parent;

   //Block signal propagation
   etk_signal_block("item-activated", ETK_OBJECT(UI_GradientSpectraComboBox),
                    ETK_CALLBACK(_gradient_spectra_combo_activated_cb), NULL);

   etk_combobox_clear(ETK_COMBOBOX(UI_GradientSpectraComboBox));

   parent = ETK_WIDGET(ETK_COMBOBOX(UI_GradientSpectraComboBox)->window);
   spectrums = l = edje_edit_spectrum_list_get(edje_o);
   while(l)
   {
      etk_combobox_item_append(ETK_COMBOBOX(UI_GradientSpectraComboBox),
                               spectra_thumb_create(parent, (char*)l->data),
                               (char*)l->data);
      l = l->next;
   }
   edje_edit_string_list_free(spectrums);

   //Reenable signal propagation
   etk_signal_unblock("item-activated", ETK_OBJECT(UI_GradientSpectraComboBox),
                    ETK_CALLBACK(_gradient_spectra_combo_activated_cb), NULL);
}
Ejemplo n.º 9
0
void etk_entropy_delete_dialog_cb(Etk_Object* w, void* user_data)
{
	Etk_Widget* window = NULL;
	int result = (int)user_data;
	entropy_generic_file* file;
	Ecore_List* files;
	entropy_gui_component_instance* instance;
	
	window = etk_object_data_get(ETK_OBJECT(w), "window");
	files= etk_object_data_get(ETK_OBJECT(window), "files");
	instance = etk_object_data_get(ETK_OBJECT(window), "instance");

	switch (result) {
		case ENTROPY_USER_INTERACTION_RESPONSE_YES: {
			ecore_list_first_goto(files);
			while ((file = ecore_list_first_remove(files))) {
				entropy_plugin_filesystem_file_remove(file, instance);
			}
		}
		break;

		case ENTROPY_USER_INTERACTION_RESPONSE_NO: {
		}
		break;
		
		default: break;
	}

	ecore_list_destroy(files);
	etk_object_destroy(ETK_OBJECT(window));
}
Ejemplo n.º 10
0
void
tree_combobox_populate(void)
{
   Eina_List *groups, *l;
   char *data;

   //Stop signal propagation
   etk_signal_block("active-item-changed", ETK_OBJECT(UI_GroupsComboBox),
                    ETK_CALLBACK(_tree_combobox_active_item_changed_cb), NULL);
   etk_signal_block("item-activated",ETK_OBJECT(UI_PartSourceComboBox),
                    _part_SourceComboBox_item_activated_cb, NULL);
   etk_combobox_entry_autosearch_set(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), -1, NULL);

   //Clear the combos
   etk_combobox_entry_clear(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox));
   etk_combobox_clear(ETK_COMBOBOX(UI_PartSourceComboBox));
   etk_combobox_item_append(ETK_COMBOBOX(UI_PartSourceComboBox), "None");

   //Populate UI_GroupsComboBox & UI_PartSourceComboBox
   groups = edje_file_collection_list(Cur.edj_temp_name->string);
   EINA_LIST_FOREACH(groups, l, data)
   {
      etk_combobox_entry_item_append(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox),
                                     data, NULL);
      etk_combobox_item_append(ETK_COMBOBOX(UI_PartSourceComboBox), data);
   }
Ejemplo n.º 11
0
/* Creates the window for the progress bar test */
void etk_test_progress_bar_window_create(void *data)
{
   static Etk_Widget *win;
   Etk_Widget *vbox;
   Etk_Widget *pbar;
   Etk_Widget *pbar2;

   if (win)
   {
      etk_widget_show_all(ETK_WIDGET(win));
      return;
   }

   win = etk_window_new();
   etk_window_title_set(ETK_WINDOW(win), "Etk Progress Bar Test");
   etk_signal_connect_by_code(ETK_WINDOW_DELETE_EVENT_SIGNAL, ETK_OBJECT(win), ETK_CALLBACK(etk_window_hide_on_delete), NULL);

   vbox = etk_vbox_new(ETK_TRUE, 5);
   etk_container_add(ETK_CONTAINER(win), vbox);

   pbar = etk_progress_bar_new_with_text("0% done");
   etk_box_append(ETK_BOX(vbox), pbar, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   pbar2 = etk_progress_bar_new_with_text("Loading...");
   etk_progress_bar_pulse_step_set(ETK_PROGRESS_BAR(pbar2), 0.015);
   etk_box_append(ETK_BOX(vbox), pbar2, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   etk_widget_show_all(win);

   _etk_test_progress_bar_timer = ecore_timer_add(0.05, _etk_test_progress_bar_update, pbar);
   _etk_test_progress_bar_timer2 = ecore_timer_add(0.025, _etk_test_progress_bar_update2, pbar2);

   etk_signal_connect_swapped_by_code(ETK_OBJECT_DESTROYED_SIGNAL, ETK_OBJECT(pbar), ETK_CALLBACK(ecore_timer_del), _etk_test_progress_bar_timer);
   etk_signal_connect_swapped_by_code(ETK_OBJECT_DESTROYED_SIGNAL, ETK_OBJECT(pbar2), ETK_CALLBACK(ecore_timer_del), _etk_test_progress_bar_timer2);
}
Ejemplo n.º 12
0
/* Menu_Item_Ckeck: Initializes the check menu item */
static void _etk_menu_item_check_constructor(Etk_Menu_Item_Check *check_item)
{
   Etk_Menu_Item *menu_item;

   if (!(menu_item = ETK_MENU_ITEM(check_item)))
      return;

   check_item->active = ETK_FALSE;
   check_item->toggled_handler = _etk_menu_item_check_toggled_handler;
   check_item->active_set = _etk_menu_item_check_active_set;

   menu_item->left_widget = etk_widget_new(ETK_WIDGET_TYPE,
      "theme-group", ETK_IS_MENU_ITEM_RADIO(check_item) ? "radiobox" : "checkbox",
      "theme-parent", check_item, "pass-mouse-events", ETK_TRUE, "visible", ETK_TRUE, NULL);
   etk_widget_parent_set(menu_item->left_widget, ETK_WIDGET(menu_item));
   etk_widget_swallow_widget(ETK_WIDGET(menu_item), "etk.swallow.left_widget", menu_item->left_widget);

   etk_widget_theme_signal_emit(ETK_WIDGET(menu_item), "etk,action,show,left_widget", ETK_TRUE);
   if (check_item->active)
      etk_widget_theme_signal_emit(menu_item->left_widget, "etk,state,on", ETK_FALSE);
   else
      etk_widget_theme_signal_emit(menu_item->left_widget, "etk,state,off", ETK_FALSE);

   etk_signal_connect_by_code(ETK_WIDGET_REALIZED_SIGNAL, ETK_OBJECT(menu_item->left_widget),
      ETK_CALLBACK(_etk_menu_item_check_box_realized_cb), menu_item);
   etk_signal_connect_by_code(ETK_MENU_ITEM_ACTIVATED_SIGNAL, ETK_OBJECT(menu_item),
      ETK_CALLBACK(_etk_menu_item_check_activated_cb), menu_item);
}
void etk_file_cache_dialog_create()
{
	Etk_Widget* window = NULL;
	Etk_Widget* tree = NULL;
	Etk_Tree_Col* tree_col;
	Etk_Widget* button;
	Etk_Widget* vbox;


	if (_etk_file_cache_dialog_running)
		return;

	_etk_file_cache_dialog_running = 1;

	window = etk_window_new();

	etk_window_title_set(ETK_WINDOW(window), "File Cache");
	etk_window_wmclass_set(ETK_WINDOW(window), "entropyfilecache", "entropyfilecache");

	etk_widget_size_request_set(ETK_WIDGET(window), 450, 500);

	vbox = etk_vbox_new(ETK_FALSE,0);
	etk_container_add(ETK_CONTAINER(window), vbox);


	tree = etk_tree_new();
	etk_box_append(ETK_BOX(vbox), tree, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);
	
	etk_tree_mode_set(ETK_TREE(tree), ETK_TREE_MODE_LIST);

	tree_col = etk_tree_col_new(ETK_TREE(tree), _("Listeners"), 125,0.0);
	etk_tree_col_model_add(tree_col, etk_tree_model_text_new());

  // Not yet implemented in Tree2
	//etk_tree_col_sort_func_set(tree_col, _entropy_etk_file_cache_dialog_listener_compare_cb, NULL);

	tree_col = etk_tree_col_new(ETK_TREE(tree), _("Filename"), 150, 0.0);
	etk_tree_col_model_add(tree_col, etk_tree_model_text_new());
        
	etk_tree_col_expand_set(tree_col, ETK_TRUE);

	etk_tree_build(ETK_TREE(tree));

	
	etk_file_cache_dialog_refresh(tree);

	button = etk_button_new_with_label("Refresh");
	etk_signal_connect("pressed", ETK_OBJECT(button), ETK_CALLBACK(_etk_file_cache_dialog_refresh_cb), tree);

	
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_END, ETK_BOX_NONE, 0);


	  etk_signal_connect ("delete_event", ETK_OBJECT (window),
		      ETK_CALLBACK (_etk_file_cache_debug_dialog_delete_cb), window);
	
	etk_widget_show_all(window);
}
Ejemplo n.º 14
0
/***   Implementation   ***/
Etk_Widget*
tree_create(void)
{
   //UI_GroupsComboBox
   UI_GroupsComboBox = etk_combobox_entry_new_default();
   etk_combobox_entry_items_height_set(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), 18);
   etk_combobox_entry_autosearch_set(ETK_COMBOBOX_ENTRY(UI_GroupsComboBox), GROUP_COMBO_AUTOSEARCH_COL, strcasestr);
  
   etk_signal_connect("active-item-changed", ETK_OBJECT(UI_GroupsComboBox),
                      ETK_CALLBACK(_tree_combobox_active_item_changed_cb), NULL);

   //UI_PartsTree
   Etk_Tree_Col *col;
   UI_PartsTree = etk_tree_new();
   etk_widget_padding_set(UI_PartsTree,2,2,2,2);
   etk_tree_mode_set(ETK_TREE(UI_PartsTree), ETK_TREE_MODE_TREE);
   etk_tree_headers_visible_set(ETK_TREE(UI_PartsTree), ETK_FALSE);
   etk_widget_size_request_set(UI_PartsTree, 260, 300);
   //Main column
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "File contents",100,0);
   etk_tree_col_model_add(col,etk_tree_model_image_new());
   etk_tree_col_model_add(col,etk_tree_model_text_new());
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_TRUE);
   //Visibility column
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "vis", 10,0);
   etk_tree_col_visible_set(col, DEBUG_MODE);
   etk_tree_col_model_add(col,etk_tree_model_checkbox_new());
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_FALSE);
   //RowType column
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "type",10, 0);
   etk_tree_col_model_add(col,etk_tree_model_int_new());
   etk_tree_col_visible_set(col, DEBUG_MODE);
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_FALSE);
   //Parent part row
   col = etk_tree_col_new(ETK_TREE(UI_PartsTree), "parent",100, 0);
   etk_tree_col_model_add(col,etk_tree_model_text_new());
   etk_tree_col_visible_set(col, DEBUG_MODE);
   etk_tree_col_resizable_set(col, ETK_FALSE);
   etk_tree_col_expand_set(col,ETK_FALSE);
   etk_tree_build(ETK_TREE(UI_PartsTree));

   etk_signal_connect("row-selected", ETK_OBJECT(UI_PartsTree),
                      ETK_CALLBACK(_tree_row_selected_cb), NULL);
   etk_signal_connect("row-clicked", ETK_OBJECT(UI_PartsTree),
                      ETK_CALLBACK(_tree_click_cb), NULL);

   //vbox
   Etk_Widget *vbox;
   vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_box_append(ETK_BOX(vbox), UI_GroupsComboBox, ETK_BOX_START, ETK_BOX_NONE, 0);
   etk_box_append(ETK_BOX(vbox), UI_PartsTree, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   return vbox;
}
Ejemplo n.º 15
0
main_window* mainwindow_create()
{/*{{{*/
	Etk_Widget *hbox,*scroll;
	main_window* win;
	win=(main_window*)malloc((unsigned int)sizeof(main_window));

	win->win = etk_window_new();
	etk_window_title_set(ETK_WINDOW(win->win), _("Exalt: network manager"));
	etk_window_wmclass_set(ETK_WINDOW(win->win),"Exalt_network_manager","Exalt_network_manager");
        etk_window_resize(ETK_WINDOW(win->win), 623,268);
	etk_signal_connect("delete-event", ETK_OBJECT(win->win), ETK_CALLBACK( mainWindow_close), win);

	hbox = etk_hbox_new(ETK_FALSE, 5);
	etk_container_add(ETK_CONTAINER(win->win), hbox);

	scroll = etk_scrolled_view_new ();
	etk_box_append(ETK_BOX(hbox), scroll, ETK_BOX_START, ETK_BOX_FILL, 0);
	etk_widget_show(scroll);

	win->eth_list = etk_tree_new();
	etk_widget_size_request_set(win->eth_list, 120, 50);

	win->eth_col0 = etk_tree_col_new(ETK_TREE(win->eth_list), _("Interfaces"), 80, 0.0);
   	etk_tree_col_model_add(win->eth_col0, etk_tree_model_image_new());
   	etk_tree_col_model_add(win->eth_col0, etk_tree_model_text_new());

	etk_tree_rows_height_set(ETK_TREE(win->eth_list),40);
	etk_tree_mode_set(ETK_TREE(win->eth_list), ETK_TREE_MODE_LIST);
	etk_tree_build(ETK_TREE(win->eth_list));
	etk_container_add(ETK_CONTAINER(scroll), win->eth_list);

	etk_signal_connect("row-clicked", ETK_OBJECT(win->eth_list),ETK_CALLBACK(mainWindow_ethList_row_clicked_cb), win);


	//add the general panel in the list
	etk_tree_row_append(ETK_TREE(win->eth_list), NULL,
    		win->eth_col0,PACKAGE_DATA_DIR ICONS_NETWORK_CONFIG,NULL,_("General") , NULL);

	//attach the add callback function to exalt
	exalt_eth_set_cb(mainWindow_eth_cb, win);

	etk_widget_show_all(win->win);

	win->eth_panel = ethpanel_create(win);
	etk_box_append(ETK_BOX(hbox),win->eth_panel->frame , ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	win->wireless_panel = wirelesspanel_create(win);
	etk_box_append(ETK_BOX(hbox),win->wireless_panel->frame , ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	win->general_panel = generalpanel_create();
	etk_box_append(ETK_BOX(hbox),win->general_panel->frame , ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

	//launch the timer to update the network state
	//win->eth_state_timer = ecore_timer_add(MAINWINDOW_ETH_STATE_TIME_MAX ,mainWindow_eth_state_timer,win);

	return win;
}/*}}}*/
Ejemplo n.º 16
0
/* Behavior of the "active_set" function for a check menu item */
static void _etk_menu_item_check_active_set(Etk_Menu_Item_Check *check_item, Etk_Bool active)
{
   if (!check_item || check_item->active == active)
      return;

   check_item->active = active;
   etk_signal_emit(ETK_MENU_ITEM_CHECK_TOGGLED_SIGNAL, ETK_OBJECT(check_item));
   etk_object_notify(ETK_OBJECT(check_item), "active");
}
Ejemplo n.º 17
0
void etk_entropy_user_interaction_dialog_cb(Etk_Object* w, void* user_data)
{
	long id = (long)etk_object_data_get(ETK_OBJECT(w),"operation");
	Etk_Widget* window = NULL;
	
        entropy_plugin_operation_respond( id, (int)user_data );

	window = etk_object_data_get(ETK_OBJECT(w), "window");
	etk_object_destroy(ETK_OBJECT(window));
}
Ejemplo n.º 18
0
/**
 * @brief Associates a response-id to the button. This way, when the button will be clicked, the "response" signal
 * of the dialog will be emitted with this response-id. This function might be useful if you pack the button yourself,
 * without using etk_dialog_pack_button_in_action_area() or etk_dialog_button_add()
 * @param dialog a dialog
 * @param button the button to associate to the dialog and to the response-id
 * @param response_id the response-id to associate to the button
 * @note The button doesn't have to be packed in the dialog
 */
void etk_dialog_button_response_id_set(Etk_Dialog *dialog, Etk_Button *button, int response_id)
{
   int *id;

   if (!dialog || !button)
      return;

   id = malloc(sizeof(int));
   *id = response_id;
   etk_object_data_set_full(ETK_OBJECT(button), "_Etk_Dialog::Response_Id", id, free);

   etk_signal_disconnect_by_code(ETK_BUTTON_CLICKED_SIGNAL, ETK_OBJECT(button), ETK_CALLBACK(_etk_dialog_button_clicked_cb), dialog);
   etk_signal_connect_by_code(ETK_BUTTON_CLICKED_SIGNAL, ETK_OBJECT(button), ETK_CALLBACK(_etk_dialog_button_clicked_cb), dialog);
}
Ejemplo n.º 19
0
ELAPI void *
el_about(void) 
{
   Etk_Widget *win, *vbox, *hbox;
   Etk_Widget *button, *label;
   Etk_Widget *about;
   Etk_Textblock *msg;
   Etk_Textblock_Iter *iter;
   char buf[4096];
   
   win = etk_dialog_new();
   etk_window_title_set(ETK_WINDOW(win), "About "PACKAGE_NAME);
   etk_window_wmclass_set(ETK_WINDOW(win), PACKAGE"_About", PACKAGE_NAME"_About");
   etk_container_border_width_set(ETK_CONTAINER(win), 3);
   etk_signal_connect("delete_event", ETK_OBJECT(win), ETK_CALLBACK(_close_cb), NULL);

   vbox = etk_vbox_new(ETK_FALSE, 0);
   etk_container_add(ETK_CONTAINER(win), vbox);
   
   label = etk_label_new("<h1>"PACKAGE_NAME"</h1>");
   etk_label_alignment_set(ETK_LABEL(label), 0.5, 0.5);
   etk_box_append(ETK_BOX(vbox), label, ETK_BOX_START, ETK_BOX_NONE, 0);

   snprintf(buf, sizeof(buf), 
	    "<b>%s is an Etk-based IRC client in development</b>\n\n"
	    "Christopher 'devilhorns' Michael\n\n%s\n", 
	    PACKAGE_NAME, PACKAGE_BUGREPORT);
   about = etk_text_view_new();
   etk_widget_size_request_set(about, 250, 150);
   etk_box_append(ETK_BOX(vbox), about, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 0);

   msg = etk_text_view_textblock_get(ETK_TEXT_VIEW(about));
   etk_textblock_object_cursor_visible_set(ETK_TEXT_VIEW(about)->textblock_object, ETK_FALSE);
   
   iter = etk_textblock_iter_new(msg);
   etk_textblock_iter_forward_end(iter);
   etk_textblock_insert_markup(msg, iter, buf, -1);

   etk_box_append(ETK_BOX(vbox), etk_hseparator_new(), ETK_BOX_END, ETK_BOX_FILL, 5);
   
   hbox = etk_hbox_new(ETK_FALSE, 3);
   etk_box_append(ETK_BOX(vbox), hbox, ETK_BOX_END, ETK_BOX_NONE, 0);

   button = etk_button_new_from_stock(ETK_STOCK_DIALOG_CLOSE);
   etk_signal_connect_swapped("clicked", ETK_OBJECT(button), ETK_CALLBACK(_close_cb), win);
   etk_box_append(ETK_BOX(hbox), button, ETK_BOX_END, ETK_BOX_NONE, 0);
   
   return win;
}
Ejemplo n.º 20
0
void show_midi_window_control(void *data){
	Etk_Widget *vbox, *vbox1, *hbox;
	Etk_Widget *frame;
	Etk_Widget *button;
	Etk_Widget *label;
	Etk_Combobox_Item *item;
	control_port_t * control_port;
	control_port = (control_port_t *)data;
	mydata = data;
	midi_t * midibinding;
	printf("tenative midi connection to ** %s \n", control_port->control_port_name);

	if (midi_win_control){
		etk_widget_show(ETK_WIDGET(midi_win_control));
		return;
	}

	midi_win_control = etk_window_new();

	etk_window_title_set(ETK_WINDOW(midi_win_control), "Set this controls Midi Properties");
	etk_window_resize(ETK_WINDOW(midi_win_control), 200, 0);
	etk_signal_connect("delete-event", ETK_OBJECT(midi_win_control), ETK_CALLBACK(etk_window_hide_on_delete), NULL);

	vbox = etk_vbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(midi_win_control), vbox);

	frame = etk_frame_new("Set Midi Binding for Control");
	etk_box_append(ETK_BOX(vbox), frame, ETK_BOX_START, ETK_BOX_EXPAND_FILL, 5);

	hbox = etk_hbox_new(ETK_FALSE, 0);
	etk_container_add(ETK_CONTAINER(frame), hbox);
	label = etk_label_new("select control change ch#");
	etk_box_append(ETK_BOX(hbox), label, ETK_BOX_START, ETK_BOX_NONE, 3);	
	
	spinnerControl = etk_spinner_new(1.0, 16.0, 1, 1.0, 5.0);
	etk_box_append(ETK_BOX(hbox), spinnerControl, ETK_BOX_START, ETK_BOX_NONE, 7);
	etk_signal_connect("value-changed", ETK_OBJECT(spinnerControl), ETK_CALLBACK(_ex_changed_value_control), 3);

	button = etk_button_new_with_label("Add Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Binding_Control, mydata);
	
	button = etk_button_new_with_label("Remove Binding");
	etk_box_append(ETK_BOX(vbox), button, ETK_BOX_START, ETK_BOX_NONE, 0);
	etk_signal_connect("clicked", ETK_OBJECT(button), _ex_Remove_Binding_Control, mydata);
	
	etk_widget_show_all(midi_win_control);   
}
Ejemplo n.º 21
0
/**
 * @brief Sets the group of the radio-button
 * @param radio_button a radio-button
 * @param group the group to use
 */
void etk_radio_button_group_set(Etk_Radio_Button *radio_button, Eina_List **group)
{
   Etk_Toggle_Button *toggle_button;
   Etk_Bool active;

   if (!(toggle_button = ETK_TOGGLE_BUTTON(radio_button)) || (group && (radio_button->group == group)))
      return;

   if (radio_button->group)
   {
      *radio_button->group = eina_list_remove(*radio_button->group, radio_button);
      if (!(*radio_button->group))
      {
         free(radio_button->group);
         radio_button->group = NULL;
      }
   }

   if (!group)
   {
      group = malloc(sizeof(Eina_List *));
      *group = NULL;
      active = ETK_TRUE;
   }
   else
      active = ETK_FALSE;

   *group = eina_list_append(*group, radio_button);
   radio_button->group = group;
   etk_object_notify(ETK_OBJECT(radio_button), "group");

   radio_button->can_uncheck = ETK_TRUE;
   etk_toggle_button_active_set(toggle_button, active);
}
Ejemplo n.º 22
0
/**
 * @brief Sets the label of the frame
 * @param frame a frame
 * @param label the label to set
 */
void etk_frame_label_set(Etk_Frame *frame, const char *label)
{
   if (!frame)
      return;

   if (label != frame->label)
   {
      free(frame->label);
      frame->label = label ? strdup(label) : NULL;
   }

   if (!frame->label || frame->label[0] == '\0')
   {
      etk_widget_theme_part_text_set(ETK_WIDGET(frame), "etk.text.label", "");
      etk_widget_theme_signal_emit(ETK_WIDGET(frame), "etk,action,hide,label", ETK_TRUE);
   }
   else
   {
      etk_widget_theme_part_text_set(ETK_WIDGET(frame), "etk.text.label", frame->label);
      etk_widget_theme_signal_emit(ETK_WIDGET(frame), "etk,action,show,label", ETK_TRUE);
   }

   if (label != frame->label)
      etk_object_notify(ETK_OBJECT(frame), "label");
}
Ejemplo n.º 23
0
/* Called when the iconbox is pressed by the mouse */
static Etk_Bool _etk_test_iconbox_mouse_down_cb(Etk_Object *object, Etk_Event_Mouse_Up *event, void *data)
{
   Etk_Iconbox *iconbox;
   Etk_Iconbox_Icon *icon;
   Etk_String *new_folder;
   char *parent;

   if (!(iconbox = ETK_ICONBOX(object)))
      return ETK_TRUE;
   if (event->button != 1 || !(event->flags & ETK_MOUSE_DOUBLE_CLICK) || (event->flags & ETK_MOUSE_TRIPLE_CLICK))
      return ETK_TRUE;
   if (!(icon = etk_iconbox_icon_get_at_xy(iconbox, event->canvas.x, event->canvas.y, ETK_FALSE, ETK_TRUE, ETK_TRUE)))
      return ETK_TRUE;

   if (!strcmp(etk_iconbox_icon_label_get(icon), ".."))
   {
      parent = ecore_file_dir_get(etk_string_get(_etk_test_iconbox_current_folder));
      _etk_test_iconbox_folder_set(iconbox, parent);
      free(parent);
   }
   else
   {
      if (etk_string_length_get(_etk_test_iconbox_current_folder) == 1)
         new_folder = etk_string_new_printf("/%s", etk_iconbox_icon_label_get(icon));
      else
         new_folder = etk_string_new_printf("%s/%s", etk_string_get(_etk_test_iconbox_current_folder),
                                            etk_iconbox_icon_label_get(icon));
      _etk_test_iconbox_folder_set(iconbox, etk_string_get(new_folder));
      etk_object_destroy(ETK_OBJECT(new_folder));
   }
   
   return ETK_TRUE;
}
Ejemplo n.º 24
0
static void evolve_gui_property_spinner_value_changed_cb(Etk_Range *range, double value)
{
   Etk_Spinner *spinner;
   Evolve_Property *prop;
   Evolve_Widget *widget;
   char value_str[64];
   
   if (!(spinner = ETK_SPINNER(range)))
     return;
   
   prop = etk_object_data_get(ETK_OBJECT(spinner), "prop");
   widget = etk_object_data_get(ETK_OBJECT(spinner), "widget");
 
   snprintf(value_str, sizeof(value_str), "%f", value);
   evolve_widget_property_set(widget, prop->name, value_str, prop->type);
}
Ejemplo n.º 25
0
Etk_Bool mainWindow_close(Etk_Object *object, void *data)
{/*{{{*/
	exalt_eth_ethernets_free();
	main_window* win = (main_window*)data;
	etk_object_destroy(ETK_OBJECT(win->win));
	exit(1);
}/*}}}*/
Ejemplo n.º 26
0
/**
 * @brief Make a menu with small stock image and sets a callback on "activated" on each elements
 * @param menu The Etk_Menu to setup
 * @param ... An (char*)menu_item name, an (Etk_Stock_Id)image id, a Etk_Callback function and 
 * it data ... terminated by NULL
 */
void
emphasis_menu_append(Etk_Widget *menu, ...)
{
  Etk_Widget *menu_item, *item_image = NULL;
  char *item_name;
  Etk_Stock_Id item_image_id;
  void *callback, *data;
  va_list arglist;

  va_start(arglist, menu);

  while ((item_name = va_arg(arglist, char *)) != NULL)
    {
      menu_item = etk_menu_item_image_new_with_label(item_name);
      item_image_id = va_arg(arglist, Etk_Stock_Id);
      if (item_image_id)
        {
          item_image =
            etk_image_new_from_stock(item_image_id, ETK_STOCK_SMALL);
          etk_menu_item_image_set(ETK_MENU_ITEM_IMAGE(menu_item),
                                  ETK_IMAGE(item_image));
        }
      callback = va_arg(arglist, void *);
      data = va_arg(arglist, void *);
      if (callback)
        {
          etk_signal_connect("activated", ETK_OBJECT(menu_item),
                             ETK_CALLBACK(callback), data);
        }

      etk_menu_shell_append(ETK_MENU_SHELL(menu), ETK_MENU_ITEM(menu_item));
    }
  va_end(arglist);
}
Ejemplo n.º 27
0
/**
 * @brief Inserts a character into a string, at a given position
 * @param string a string. If @a string is NULL, a new string is created
 * @param pos the position where to insert the char
 * @param c the character to insert into the string
 * @return Returns the string
 */
Etk_String *etk_string_insert_char(Etk_String *string, int pos, char c)
{
   int i;

   if (!string)
      return etk_string_insert_char(etk_string_new(NULL), pos, c);
   if (c == '\0')
      return etk_string_truncate(string, pos);

   pos = ETK_CLAMP(pos, 0, string->length);
   if (string->length + 1 > string->allocated_length)
   {
      string->string = realloc(string->string, SIZE_TO_ALLOC(string->length + 1) + 1);
      string->allocated_length = SIZE_TO_ALLOC(string->length + 1);
   }
   for (i = string->length - 1; i >= pos; i--)
      string->string[i + 1] = string->string[i];

   string->string[pos] = c;
   string->length++;
   string->string[string->length] = '\0';

   etk_object_notify(ETK_OBJECT(string), "string");
   return string;
}
Ejemplo n.º 28
0
void etk_directory_add_dialog_cancel_cb(Etk_Object* w, void* user_data) 
{
	etk_directory_add_dialog* dialog = user_data;

	etk_object_destroy(ETK_OBJECT(dialog->window));
	free(dialog);
}
Ejemplo n.º 29
0
/**
 * @brief Sets the group of the radio menu-item
 * @param radio_item a radio menu-item
 * @param group the group to set
 */
void etk_menu_item_radio_group_set(Etk_Menu_Item_Radio *radio_item, Eina_List **group)
{
   Etk_Menu_Item_Check *check_item;
   Etk_Bool active;

   if (!(check_item = ETK_MENU_ITEM_CHECK(radio_item)) || (group && (radio_item->group == group)))
      return;

   if (radio_item->group)
   {
      *radio_item->group = eina_list_remove(*radio_item->group, radio_item);
      if (!(*radio_item->group))
      {
         free(radio_item->group);
         radio_item->group = NULL;
      }
   }

   if (!group)
   {
      group = malloc(sizeof(Eina_List *));
      *group = NULL;
      active = ETK_TRUE;
   }
   else
      active = ETK_FALSE;

   *group = eina_list_append(*group, radio_item);
   radio_item->group = group;
   etk_object_notify(ETK_OBJECT(radio_item), "group");

   radio_item->can_uncheck = ETK_TRUE;
   etk_menu_item_check_active_set(check_item, active);
}
Ejemplo n.º 30
0
/**
 * @brief Sets whether or not the spinner's value should wrap around to the opposite limit when the value exceed one
 * of the spinner's bounds
 * @param spinner a spinner
 * @param wrap ETK_TRUE to make the value wrap around, ETK_FALSE otherwise
 */
void etk_spinner_wrap_set(Etk_Spinner *spinner, Etk_Bool wrap)
{
   if (!spinner || spinner->wrap == wrap)
      return;

   spinner->wrap = wrap;
   etk_object_notify(ETK_OBJECT(spinner), "wrap");
}