Пример #1
0
static void
_cb_feed_down(void *data, void *data2)
{
   E_Config_Dialog_Data *cfdata;
   News_Feed *f;
   News_Item *ni;
   News_Feed_Ref *ref;
   Eina_List *sel, *l, *lf;

   cfdata = data;
   ni = cfdata->ni;

   for (sel=eina_list_last(cfdata->ilist_selected_feeds_sel); sel; sel=eina_list_prev(sel))
     {
        f = sel->data;
        ref = news_feed_ref_find(f, ni);
        if (!ref) return;

        l = eina_list_data_find_list(ni->config->feed_refs, ref);
        lf = eina_list_next(l);
        if (!lf) return;
  
        ni->config->feed_refs = eina_list_remove_list(ni->config->feed_refs, l);
        ni->config->feed_refs = eina_list_append_relative_list(ni->config->feed_refs,
                                                               ref, lf);
     }

   news_item_refresh(ni, 1, 0, 0);
   news_config_dialog_item_content_refresh_selected_feeds(ni);
}
Пример #2
0
/* Move to right is basically the same as move to left of (num+1) */
static int
border_move_to_right(E_Border *bd,
                     int       times)
{
   Eina_List *n, *p;
   void *data;
   int c;

   if (!bd || !_G.tinfo) return 0;
   if (!(n = eina_list_data_find_list(_G.tinfo->client_list, bd))) return 0;
   if (!(p = n->next)) return 0;
   data = n->data;
   for (c = 0; c < (times - 1); c++)
     if (!(p = p->next)) return 0;
   _G.tinfo->client_list = eina_list_remove_list(_G.tinfo->client_list, n);
   _G.tinfo->client_list = eina_list_append_relative_list(_G.tinfo->client_list, data, p);
   return 1;
}
Пример #3
0
/* Adds a new widget to the box, after the cell "after" */
static void _etk_box_insert_after_cell(Etk_Box *box, Etk_Widget *child, Etk_Box_Group group, Etk_Box_Cell *after, Etk_Box_Fill_Policy fill_policy, int padding)
{
   Etk_Box_Cell *cell;
   Etk_Widget *box_widget;

   if (!(box_widget = ETK_WIDGET(box)) || !child)
      return;
   if (after && after->group != group)
   {
      ETK_WARNING("The child to pack and the widget after which the child should be packed "
         "do not belong to the same child-group");
      return;
   }

   cell = malloc(sizeof(Etk_Box_Cell));
   cell->prev = NULL;
   cell->next = NULL;
   cell->child = child;
   cell->focus_node = NULL;
   cell->group = group;
   cell->fill_policy = fill_policy;
   cell->padding = padding;

   if (after)
   {
      cell->prev = after;
      cell->next = after->next;
      if (after->next)
         after->next->prev = cell;
      else
         box->last_cell[group] = cell;
      after->next = cell;

      box_widget->focus_order = eina_list_append_relative_list(box_widget->focus_order, child, after->focus_node);
      cell->focus_node = eina_list_next(after->focus_node);
   }
   else
   {
      cell->next = box->first_cell[group];
      if (box->first_cell[group])
         box->first_cell[group]->prev = cell;
      else
         box->last_cell[group] = cell;
      box->first_cell[group] = cell;

      if (group == ETK_BOX_START || !box->last_cell[ETK_BOX_START])
      {
         box_widget->focus_order = eina_list_prepend(box_widget->focus_order, child);
         cell->focus_node = box_widget->focus_order;
      }
      else
      {
         box_widget->focus_order = eina_list_append_relative_list(box_widget->focus_order,
               child, box->last_cell[ETK_BOX_START]->focus_node);
         cell->focus_node = eina_list_next(box->last_cell[ETK_BOX_START]->focus_node);
      }
   }
   box->cells_count[group]++;

   etk_widget_parent_set(child, ETK_WIDGET(box));
   etk_object_data_set(ETK_OBJECT(child), "_Etk_Box::Cell", cell);
   etk_signal_emit(ETK_CONTAINER_CHILD_ADDED_SIGNAL, ETK_OBJECT(box), child);
}