entropy_notification_engine* entropy_notification_engine_init() {
	entropy_notification_engine* notify = entropy_malloc(sizeof(entropy_notification_engine));

	/*Init the ecore_list for operation queueing */
	notify->op_queue = ecore_list_new();
	notify->exe_queue = ecore_list_new();
	
	//printf("Initializing the notify engine..\n");

	notify->server = ecore_ipc_server_connect(ECORE_IPC_LOCAL_USER, IPC_TITLE, 0, NULL);
	/*notify->notify_thread_id = pthread_create(&notify->notify_thread, NULL, entropy_notify_loop, (void*)notify);*/

	return notify;
}
entropy_notify_event* entropy_notify_event_new() {
	entropy_notify_event* event;
	
	event = entropy_malloc(sizeof(entropy_notify_event));
	event->return_struct = NULL;
	event->event_type = ENTROPY_NOTIFY_GENERIC;
	event->cb_list = ecore_list_new();
	event->cleanup_list = ecore_list_new();

	/*Track alloc*/
	allocated_events++;
	print_allocation();

	return event;
}
/**
 * Retrieves an ecore_list of all keys in the given hash.
 * @param   hash          The given hash.
 * @return  new ecore_list on success, NULL otherwise
 * @ingroup Ecore_Data_Hash_ADT_Traverse_Group
 */
EAPI Ecore_List *
ecore_hash_keys(Ecore_Hash *hash)
{
   unsigned int i = 0;
   Ecore_List *keys;

   CHECK_PARAM_POINTER_RETURN("hash", hash, NULL);

   keys = ecore_list_new();
   while (i < ecore_prime_table[hash->size])
     {
        if (hash->buckets[i])
          {
             Ecore_Hash_Node *node;

             for (node = hash->buckets[i]; node; node = node->next)
               {
                  ecore_list_append(keys, node->key);
               }
          }

        i++;
     }
   ecore_list_first_goto(keys);

   return keys;
}
Beispiel #4
0
static Ecore_List *
_list_keys_order (Ecore_List *keys)
{
  Ecore_List *l;
  char       *key;

  l = ecore_list_new ();
  ecore_list_first_goto(keys);
  while ((key = ecore_list_next(keys)))
    {
      char *str;

      ecore_list_first_goto (l);
      while ((str = ecore_list_next(l)) &&
             (strcasecmp (key, str) >= 0)) { }

      if (!str)
        ecore_list_append (l, key);
      else
        {
          ecore_list_index_goto (l, ecore_list_index (l) - 1);
          ecore_list_insert (l, key);
        }
    }

  ecore_list_destroy (keys);

  return l;
}
Beispiel #5
0
Ecore_List* entropy_plugins_type_get(int type, int subtype) {
	entropy_plugin* list_item;

	Ecore_List* plugins = entropy_core_get_core()->plugin_list;
	
	if (plugin_list) {
		ecore_list_destroy(plugin_list);
	}

	plugin_list = ecore_list_new();
	
	ecore_list_first_goto(plugins);
	while ( (list_item = ecore_list_next(plugins)) ) {
		/*printf("Scanning plugin: %s\n", list_item->filename);*/
		if (list_item->type == type && 
		   (subtype == ENTROPY_PLUGIN_SUB_TYPE_ALL || subtype == list_item->subtype)
		   && (type != ENTROPY_PLUGIN_GUI_COMPONENT || 
		(type == ENTROPY_PLUGIN_GUI_COMPONENT && 
		 !strcmp(list_item->toolkit, entropy_layout_global_toolkit_get())))) {
			ecore_list_append(plugin_list, list_item);
		}
	}
	
	return plugin_list;	
}
Beispiel #6
0
Ecore_List* evfs_plugin_meta_types_get()
{
	Ecore_List* list = ecore_list_new();

	ecore_list_append(list, "image/png");
	ecore_list_append(list, "images/jpeg");
	ecore_list_append(list, "image/gif");
	ecore_list_append(list, "video/x-ms-wmv");
	ecore_list_append(list, "application/msword");
	ecore_list_append(list, "application/pdf");
	ecore_list_append(list, "application/vnd.ms-excel");
	ecore_list_append(list, "application/x-gtar");
	ecore_list_append(list, "text/html");
	ecore_list_append(list, "video/mpeg");
	ecore_list_append(list, "video/x-msvideo");
	ecore_list_append(list, "application/x-gtar");
	ecore_list_append(list, "application/x-bzip2");
	ecore_list_append(list, "video/quicktime");
	ecore_list_append(list, "video/x-ms-asf");
 	ecore_list_append(list, "object/undefined");

	



	return list;
}
Beispiel #7
0
/**
 * @brief get the dns list
 * @return Return the dns list
 */
Ecore_List* exalt_dns_get_list()
{
    FILE* f;
    char buf[1024];
    char *addr;
    Ecore_List* l;

    f = fopen(EXALT_RESOLVCONF_FILE, "ro");
    EXALT_ASSERT_RETURN(f!=NULL);

    l = ecore_list_new();
    l->free_func = free;
    while(fgets(buf,1024,f))
    {
        buf[strlen(buf)-1] = '\0';
        //jump nameserver
        if(strlen(buf) > 13)
        {
            addr = buf + 11;
            if(exalt_is_address(addr))
                ecore_list_append(l, strdup(addr));
        }
    }
    EXALT_FCLOSE(f);
    return l;
}
static Group       *
GroupCreate(int gid)
{
   Group              *g;

   g = ECALLOC(Group, 1);
   if (!g)
      return NULL;

   if (!group_list)
      group_list = ecore_list_new();
   ecore_list_append(group_list, g);

   if (gid == -1)
     {
	/* Create new group id */
	/* ... using us time. Should really be checked for uniqueness. */
	g->index = (int)GetTimeUs();
     }
   else
     {
	/* Use given group id */
	g->index = gid;
     }
   g->cfg.iconify = Conf_groups.dflt.iconify;
   g->cfg.kill = Conf_groups.dflt.kill;
   g->cfg.move = Conf_groups.dflt.move;
   g->cfg.raise = Conf_groups.dflt.raise;
   g->cfg.set_border = Conf_groups.dflt.set_border;
   g->cfg.stick = Conf_groups.dflt.stick;
   g->cfg.shade = Conf_groups.dflt.shade;

   Dprintf("grp=%p gid=%d\n", g, g->index);
   return g;
}
Beispiel #9
0
/**
 * Move the current xml document pointer to the indicated node
 * @param   xml The xml document
 * @param   node The position within the document to move to
 * @return  The current xml tag name
 * @ingroup EXML_Traversal_Group
 */
char *exml_goto_node(EXML *xml, EXML_Node *node)
{
	Ecore_List *stack;
	EXML_Node *n, *l;

	CHECK_PARAM_POINTER_RETURN("xml", xml, NULL);

	stack = ecore_list_new();
	n = node;

	while( n->parent != NULL ) {
		ecore_list_prepend(stack, n);
		n = n->parent;
	}

	l = xml->top;

	if (n != l)
		return NULL;

	while( (n = ecore_list_first_remove(stack)) ) {
		l = ecore_list_goto(l->children, n);

		if (!l)
			return NULL;
	}

	xml->current = node;

	return xml->current ? xml->current->tag : NULL;
}
Beispiel #10
0
char *
EvfsFilereference_to_string(EvfsFilereference * ref)
{
   int length = 0;
   char *uri;
   Ecore_List *parent_list = ecore_list_new();
   EvfsFilereference *parent;

   ecore_list_prepend(parent_list, ref);
   length += strlen(ref->plugin_uri) + strlen("://");
   if (ref->username)
     {
        length +=
           strlen(ref->username) + strlen(ref->password) + strlen(":") +
           strlen("@");
     }
   length += strlen(ref->path);

   while ((parent = ref->parent))
     {
        ecore_list_prepend(parent_list, parent);

        length += strlen(parent->plugin_uri) + strlen("://");
        if (parent->username)
          {
             length +=
                strlen(parent->username) + strlen(parent->password) +
                strlen(":") + strlen("@");

          }

        length += strlen(parent->path);
        length += strlen("#");

     }
   length += 1;
   uri = calloc(length, sizeof(char));

   while ((parent = ecore_list_first_remove(parent_list)))
     {
        strcat(uri, parent->plugin_uri);
        strcat(uri, "://");
        if (parent->username)
          {
             strcat(uri, parent->username);
             strcat(uri, ":");
             strcat(uri, parent->password);
             strcat(uri, "@");
          }
        strcat(uri, parent->path);
        if (ecore_list_next(parent_list))
           strcat(uri, "#");
     }

   ecore_list_destroy(parent_list);

   return uri;

}
Beispiel #11
0
void
widget_clear_ui_hooks( Ewler_Widget *w )
{
	Ecore_Hash *elems;
	Ecore_List *elems_stack;
	Ecore_List *names, *names_stack;
	char *name;

	names = ecore_hash_keys(w->elems);

	elems = w->elems;

	elems_stack = ecore_list_new();
	names_stack = ecore_list_new();

	while( (name = ecore_list_next(names)) ) {
		Ewler_Widget_Elem *elem;

		elem = ecore_hash_get(elems, name);

		elem->entry = NULL;
		elem->text = NULL;
		if( elem->items )
			ecore_hash_destroy(elem->items);
		elem->items = NULL;

		if( elem->spec->type == EWLER_SPEC_ELEM_STRUCT ) {
			ecore_list_prepend(elems_stack, elems);
			ecore_list_prepend(names_stack, names);

			elems = elem->info.children;
			names = ecore_hash_keys(elems);
		}

		while( !ecore_list_current(names) && elems != w->elems ) {
			ecore_list_destroy(names);
			elems = ecore_list_first_remove(elems_stack);
			names = ecore_list_first_remove(names_stack);
		}
	}

	ecore_list_destroy(names);
	ecore_list_destroy(elems_stack);
	ecore_list_destroy(names_stack);
}
Beispiel #12
0
Eim * eim_new () {
#ifdef CORE_DEBUG
  printf("TRACE: eim_new\n");
#endif
  /* create the eim object */
  Eim * tmp = EIM(malloc(sizeof(Eim)));
  
  /* allocates the lists of egxp object */
  tmp->egxps = ecore_list_new ();
  ecore_list_set_free_cb (tmp->egxps, egxp_free);

  /* allocates the list of properties accounts */
  tmp->account_properties = ecore_list_new ();
  ecore_list_set_free_cb (tmp->account_properties, account_properties_free);
  
  /* return the newly created object */
  return tmp;
}
void entropy_etk_delete_dialog_single_new(entropy_gui_component_instance* instance, entropy_generic_file* file)
{
	Ecore_List* files;

	files = ecore_list_new();
	ecore_list_append(files,file);

	entropy_etk_delete_dialog_new(instance,files);
}
Beispiel #14
0
int
posix_monitor_add(evfs_client * client, evfs_command * command)
{
   Ecore_List *mon_list =
      ecore_hash_get(posix_monitor_hash, evfs_command_first_file_get(command)->path);
   evfs_file_monitor *mon;
   evfs_file_monitor *old;

   mon = calloc(1, sizeof(evfs_file_monitor));
   mon->client = client;
   mon->monitor_path = strdup(evfs_command_first_file_get(command)->path);

   /*Check if we are already monitoring, if not, make a new list of monitors.. */
   if (!mon_list)
     {
        /*printf("No previous instance, making a new list, monitoring..\n"); */

        mon_list = ecore_list_new();
        ecore_hash_set(posix_monitor_hash, mon->monitor_path, mon_list);

        printf("Adding monitor on path '%s'\n", mon->monitor_path);
        if (!
            (mon->em =
             ecore_file_monitor_add(mon->monitor_path,
                                    &evfs_file_monitor_fam_handler,
                                    mon->monitor_path)))
          {
             fprintf(stderr, "EVFS: Error monitoring '%s'\n",
                     mon->monitor_path);
          }

        ecore_list_append(mon_list, mon);
     }
   else
     {
        if (!client_already_monitoring(client, mon_list))
          {
             /*We assume there is something already in the list.  This is probably bad a bad assumption */
             ecore_list_first_goto(mon_list);
             old = ecore_list_current(mon_list);

             /*Make sure we have the ecore ref, so the last monitor can nuke it */
             mon->em = old->em;
             ecore_list_append(mon_list, mon);
          }
        else
          {
             printf("Oi, dufus, you're already monitoring this object\n");
          }

     }

   return 0;

}
Beispiel #15
0
/**
 * Initialize an XML_Node to starting values
 * @param   node The node to initialize
 * @return  @c TRUE if successful, @c FALSE if an error occurs.
 * @ingroup EXML_Creation_Group
 */
int exml_node_init(EXML_Node *node)
{
	CHECK_PARAM_POINTER_RETURN("node", node, FALSE);

	node->attributes = ecore_hash_new( ecore_str_hash, ecore_str_compare );
	ecore_hash_free_value_cb_set( node->attributes, free );
	ecore_hash_free_key_cb_set( node->attributes, free );
	node->children = ecore_list_new();
	ecore_list_free_cb_set( node->children, _exml_node_destroy );

	return TRUE;
}
Beispiel #16
0
Epsilon_Plugin *
epsilon_plugin_init (void)
{
  Epsilon_Plugin *plugin = calloc (1, sizeof (Epsilon_Plugin));
  plugin->epsilon_generate_thumb = &epsilon_generate_thumb;
  plugin->mime_types = ecore_list_new ();

  ecore_list_append (plugin->mime_types, "video/mpeg");
  ecore_list_append (plugin->mime_types, "video/x-ms-wmv");
  ecore_list_append (plugin->mime_types, "video/x-msvideo");
  ecore_list_append (plugin->mime_types, "video/quicktime");

  return plugin;
}
Beispiel #17
0
static ImageClass  *
ImageclassCreate(const char *name)
{
   ImageClass         *ic;

   ic = ECALLOC(ImageClass, 1);
   if (!ic)
      return NULL;

   if (!iclass_list)
      iclass_list = ecore_list_new();
   ecore_list_prepend(iclass_list, ic);

   ic->name = Estrdup(name);

   return ic;
}
Beispiel #18
0
void
ecrin_ewl_list_fill_package (char *aiguille)
{
  Ewl_Widget *row;
  char       *key;

  if (list_rows)
    ecore_list_destroy (list_rows);

  list_rows = ecore_list_new ();

  if (!aiguille)
    aiguille = "";

  ecore_list_first_goto(sorted_keys);
  while ((key = ecore_list_next(sorted_keys)))
    {
      Ecrin_Hash_Data *data;
      
      data = ecrin_hash_data_get (key);

      if (strstr (key, aiguille))
        {
          row = ewl_tree_text_row_add (EWL_TREE (list), NULL,
                                       &data->data_name);

          ecore_list_append (list_rows, row);

          switch (data->type)
            {
            case HASH_DATA_ENUM:
              ewl_callback_append (row, EWL_CALLBACK_CLICKED, _enum_display, data);
              break;
            case HASH_DATA_DEFINE:
              ewl_callback_append (row, EWL_CALLBACK_CLICKED, _define_display, data);
              break;
            case HASH_DATA_FUNCTION:
              ewl_callback_append (row, EWL_CALLBACK_CLICKED, _function_display, data);
              break;
            default:
              break;
            }
        }
    }

}
Beispiel #19
0
int
evfs_client_disconnect(evfs_client * client)
{
   Ecore_List *mon_list;
   Ecore_List *indiv_list;
   evfs_file_monitor *mon;
   char *key;
   Ecore_List *watched_keys = ecore_list_new();

   /*printf("Received disconnect for client at evfs_fs_posix.c for client %lu\n",
          client->id);
   printf("Scanning monitors for client and removing...\n");*/

   mon_list = ecore_hash_keys(posix_monitor_hash);
   if (mon_list)
     {
        while ((key = ecore_list_first_remove(mon_list)))
          {
             /*printf("Looking for clients for '%s'\n", key);*/

             indiv_list = ecore_hash_get(posix_monitor_hash, key);
             ecore_list_first_goto(indiv_list);

             while ((mon = ecore_list_next(indiv_list)))
               {
                  if (mon->client == client)
                    {
                       ecore_list_append(watched_keys, key);
                    }
               }
          }
        ecore_list_destroy(mon_list);
     }
   else
     {
        /*printf("No directories/files monitored by any client\n");*/
     }

   while ((key = ecore_list_first_remove(watched_keys)))
     {
        evfs_posix_monitor_remove(client, key);
     }
   ecore_list_destroy(watched_keys);
   return 1;
}
XmppIM_Contact * xmpp_im_contact_new (Xmpp_JID * jid, char * name) {
#ifdef XMPPIM_DEBUG
  _contact_num += 1;
  printf("TRACE:xmpp_im_contact_new %d - %s\n", _contact_num, name);
#endif
  assert (jid);

  /* create the contact variable */
  XmppIM_Contact * tmp = XMPPIM_CONTACT(malloc(sizeof (XmppIM_Contact)));
  
  /* set default variable */
  tmp->jid = jid;
  tmp->name = strdup (name);
  tmp->groups = ecore_list_new ();
  tmp->presence = -1; // not available
  
  return tmp;
}
Beispiel #21
0
/**
 * Initialize an xml stylesheet structure to some sane starting values.
 * @param   xsl The stylesheet to initialize.
 * @return  @c TRUE if successful, @c FALSE if an error occurs.
 * @ingroup EXML_XSLT_Group
 */
int exml_xsl_init( EXML_XSL *xsl, char *filename )
{
	CHECK_PARAM_POINTER_RETURN("xsl", xsl, FALSE);

	xmlSubstituteEntitiesDefault(1);

	xmlLoadExtDtdDefaultValue = 1;

	xsl->buffers = ecore_list_new();
	ecore_list_free_cb_set(xsl->buffers, ECORE_FREE_CB(xmlFree));

	xsl->cur = xsltParseStylesheetFile((const xmlChar *) filename);

	if( !xsl->cur )
		return FALSE;

	return TRUE;
}
Beispiel #22
0
static MenuStyle   *
MenuStyleCreate(const char *name)
{
   MenuStyle          *ms;

   ms = ECALLOC(MenuStyle, 1);
   if (!ms)
      return NULL;

   if (!menu_style_list)
      menu_style_list = ecore_list_new();
   ecore_list_prepend(menu_style_list, ms);

   ms->name = Estrdup(name);
   ms->iconpos = ICON_LEFT;

   return ms;
}
Beispiel #23
0
void egxp_node_add_condition (Egxp_Node * cn, Egxp_Condition * cond) {
#ifdef EGXP_DEBUG
  printf("TRACE: egxp_node_add_condition\n");
#endif
  
  assert (cn && cond);
   
  /* check if the node is already attached to a parent. If it is already 
     attached we generate an error */
  assert (cn->parent == NULL);

  /* check if the conditions lists is created */
  if (cn->conditions == NULL) {
    cn->conditions = ecore_list_new ();
    ecore_list_set_free_cb (cn->conditions, (Ecore_Free_Cb)egxp_condition_free);
  }
  
  /* append the condition */
  ecore_list_append (cn->conditions, cond);
}
Beispiel #24
0
Epsilon_Plugin *
epsilon_plugin_init ()
{
   Epsilon_Plugin *plugin;

   plugin = calloc (1, sizeof (Epsilon_Plugin));
   if (!plugin) return NULL;

   plugin->mime_types = ecore_list_new ();
   if (!plugin->mime_types)
     {
        free(plugin);
	return NULL;
     }
   plugin->epsilon_generate_thumb = &epsilon_generate_thumb;

   ecore_list_append (plugin->mime_types, "application/dvi");

   return plugin;
}
Beispiel #25
0
void ewl_entropy_tip_window_create_tips()
{
    tool_tips = ecore_list_new();
    ecore_list_append(tool_tips, "You can add a new 'location' by clicking on \"Add Location\"\nin the Tools menu");
    ecore_list_append(tool_tips, "Entropy can browse .tar.gz and .tar.bz2 files.  Just click on the\n file, and it will be"
                      "treated as a regular folder");
    ecore_list_append(tool_tips, "To copy a file, drag the icon from the icon view to a folder in the left hand pane");
    ecore_list_append(tool_tips, "The icon view supports keyboard navigation.  Arrow keys, and special keys\n like 'Delete'"
                      "will execute appropriate actions");
    ecore_list_append(tool_tips, "File properties can be viewed by selecting an icon, and clicking 'Properties'");
    ecore_list_append(tool_tips, "You can change the action that is executed for a particular file type\n"
                      "by opening the 'Properties' dialog for a file of that type, and clicking\n"
                      "'Open With..'");
    ecore_list_append(tool_tips, "The MIME-Type dialog allows fine grained control over the action executed\n"
                      "for a file type.");
    ecore_list_append(tool_tips, "Entropy is able to thumbnail images in any filesystem supported by EVFS.\n"
                      "For instance, this means that Entropy can thumbnail files in a .tar.bz2\n"
                      "file on a Samba share!\n");


}
Beispiel #26
0
Menu               *
MenuCreate(const char *name, const char *title, Menu * parent, MenuStyle * ms)
{
   Menu               *m;

   m = ECALLOC(Menu, 1);
   if (!m)
      return m;

   m->parent = parent;
   MenuSetName(m, name);
   MenuSetTitle(m, title);
   if (ms)
      MenuSetStyle(m, ms);
   m->icon_size = -1;		/* Use image size */

   if (!menu_list)
      menu_list = ecore_list_new();
   ecore_list_append(menu_list, m);

   return m;
}
Beispiel #27
0
static void
epdf_index_fill (Ecore_List *items,
                 GooList    *gitems)
{
  if (!items || !gitems)
    return;

  for (int i = 0; i < gitems->getLength (); i++) {
    Epdf_Index_Item *item;
    OutlineItem     *oitem = (OutlineItem *)gitems->get (i);
    Unicode         *utitle = oitem->getTitle ();

    item = epdf_index_item_new ();
    item->title = unicode_to_char (utitle, oitem->getTitleLength ());
    item->action = oitem->getAction ();
    oitem->open ();
    if (oitem->hasKids () && oitem->getKids ()) {
      item->children = ecore_list_new ();
      epdf_index_fill (item->children, oitem->getKids ());
    }
    ecore_list_append (items, item);
  }
}
Beispiel #28
0
Ecore_List *
epdf_index_new (const Epdf_Document *document)
{
  Outline    *outline;
  GooList    *gitems;
  Ecore_List *index = NULL;

  if (!document)
    return index;

  outline = document->pdfdoc->getOutline ();
  if (outline == NULL)
    return index;

  gitems = outline->getItems ();
  if (gitems == NULL)
    return index;

  index = ecore_list_new ();
  epdf_index_fill (index, gitems);

  return index;
}
Beispiel #29
0
static ToolTip     *
TooltipCreate(const char *name, const char *ic0, const char *ic1,
	      const char *ic2, const char *ic3, const char *ic4,
	      const char *tclass, int dist, const char *tooltippic)
{
   ToolTip            *tt;
   ImageClass         *ic;

   if (!ic0 || !tclass)
      return NULL;

   ic = ImageclassAlloc(ic0, 0);
   if (!ic)
      return NULL;

   tt = ECALLOC(ToolTip, 1);
   if (!tt)
      return NULL;

   tt->name = Estrdup(name);
   tt->iclass[0] = ImageclassAlloc(ic1, 0);
   tt->iclass[1] = ImageclassAlloc(ic2, 0);
   tt->iclass[2] = ImageclassAlloc(ic3, 0);
   tt->iclass[3] = ImageclassAlloc(ic4, 0);
   tt->iclass[4] = ic;
   tt->tclass = TextclassAlloc(tclass, 1);
   tt->tooltippic = ImageclassAlloc(tooltippic, 0);

   tt->dist = dist;

   if (!tt_list)
      tt_list = ecore_list_new();
   ecore_list_prepend(tt_list, tt);

   return tt;
}
Beispiel #30
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;
}