示例#1
0
    static E_Gadcon_Client *
_gc_init(E_Gadcon *gc, const char *name, const char *id, const char *style)
{
    Instance *inst;
    E_Gadcon_Client *gcc;
    char buf[PATH_MAX];

    snprintf(buf, sizeof(buf), "%s/exalt.edj", e_module_dir_get(exalt_config->module));

    inst = E_NEW(Instance, 1);
    inst->o_button = edje_object_add(gc->evas);
    if (!e_theme_edje_object_set(inst->o_button, "base/theme/modules/exalt",
                "modules/exalt/main"))
        edje_object_file_set(inst->o_button, buf, "e/modules/exalt/main");

    gcc = e_gadcon_client_new(gc, name, id, style, inst->o_button);
    gcc->data = inst;
    inst->gcc = gcc;

    evas_object_event_callback_add(inst->o_button, EVAS_CALLBACK_MOUSE_DOWN, _cb_mouse_down, inst);

    exalt_config->instances = evas_list_append(exalt_config->instances, inst);

    exalt_dbus_notify_set( exalt_config->conn, _exalt_notify_cb, inst);

    return gcc;
}
示例#2
0
/*
 * @brief add an interface in the configuration file
 * @param interface the interface name
 * @param file the configuration file
 * @return Returns 1 if success
 */
int waiting_iface_add(const char* interface,const char* file)
{
    Exalt_Ethernet* eth;
    Boot_Process_List *l;

    EXALT_ASSERT_RETURN(interface!=NULL);
    EXALT_ASSERT_RETURN(file!=NULL);

    l= waiting_iface_load(file);
    //add the new interface
    Boot_Process_Elt *elt = malloc(sizeof(Boot_Process_Elt));
    EXALT_STRDUP(elt->interface,interface);
    l->l = evas_list_append(l->l, elt);

    //save the new list
    waiting_iface_save(l,file);

    waiting_iface_free(&l);

    //we send a broadcast on dbus
    eth = exalt_eth_get_ethernet_byname(interface);
    if(eth)
        eth_cb(eth,EXALTD_ETH_CB_WAITINGBOOT_CHANGE,exaltd_conn);

    return 1;
}
示例#3
0
void
med_mark_entry_dirty(E_Entry *_entry)
{

   if(!evas_list_find(dirty_entries, _entry))
     {
       dirty_entries = evas_list_append(dirty_entries, _entry);
     }

   med_show_commit_tool();
}
示例#4
0
文件: mux_midi.c 项目: eriser/ayemux
/* built when a state is created */
void midi_create(void){
	midi_t * midibinding;
	
	midibinding = malloc(sizeof(midi_t));
	midibinding->type = 0;
	midibinding->channel = 0;
	midibinding->program = 0;
	midibinding->trow = NULL;

	// here is the crash
	live_plugin->midi_data = evas_list_append(live_plugin->midi_data, midibinding);
	if (evas_list_alloc_error()){
	     fprintf(stderr, "ERROR: Memory is low. List allocation failed.\n");
	     exit(-1);
	}
	
}
示例#5
0
Evas_List * 
e_file_ls(char *dir)
{
   DIR                *dirp;
   struct dirent      *dp;
   Evas_List *           list;
   
   D_ENTER;
   
   dirp = opendir(dir);
   if (!dirp) D_RETURN_(NULL);
   list = NULL;
   while ((dp = readdir(dirp)))
     {
	if ((strcmp(dp->d_name, ".")) &&
	    (strcmp(dp->d_name, "..")))
	  {
	     Evas_List * l;
	     char *f;
	     
	     /* insertion sort */
	     for (l = list; l; l = l->next)
	       {
		  if (strcmp(l->data, dp->d_name) > 0)
		    {
		       e_strdup(f, dp->d_name);
		       list = evas_list_prepend_relative(list, f, l->data);
		       break;
		    }
	       }
	     /* nowhwre to go? just append it */
	     e_strdup(f, dp->d_name);
	     if (!l) list = evas_list_append(list, f);
	  }
     }
   closedir(dirp);

   D_RETURN_(list);
}
示例#6
0
void
e_login_session_bar_init(E_Login_Session e)
{
   int w, h;
   Evas *evas;
   Estyle *es = NULL;
   double bgx, bgy, bgw, bgh;
   int ix = 0, iy = 0;
   int iw = 0, ih = 0;
   Evas_List *l = NULL;
   Evas_Object *o = NULL;

   Session_Bar *sb = session_bar_new();

   /* Session list background image */
   evas = e->evas;

   o = evas_object_image_add(evas);
   evas_object_image_file_set(o, PACKAGE_DATA_DIR "/data/images/parch.png",
                              NULL);
   iw = ih = 0;
   evas_object_image_fill_set(o, 0.0, 0.0, (double) iw, (double) ih);
   evas_object_resize(o, iw, ih);
   evas_object_layer_set(o, 15);
   evas_object_color_set(o, e->config->greeting.font.r,
                         e->config->greeting.font.g,
                         e->config->greeting.font.b, 100);
   ix = ((((e->geom.w / e->config->screens.w) - w) * 0.5));
   iy = 120;
   evas_object_move(o, ix, iy);
   sb->listbg = o;

   /* Session list heading */
   es = estyle_new(evas, "XSessions", "raised");
   estyle_set_color(es, e->config->greeting.font.r,
                    e->config->greeting.font.g, e->config->greeting.font.b,
                    e->config->greeting.font.a);
   estyle_set_font(es, e->config->greeting.font.name,
                   e->config->greeting.font.size);
   estyle_callback_add(es, EVAS_CALLBACK_MOUSE_UP,
                       session_bar_toggle_visibility, sb);
   estyle_set_layer(es, 25);
   estyle_geometry(es, NULL, NULL, &w, &h);
   ix = ((((e->geom.w / e->config->screens.w) - w) * 0.9));
   iy = ((((e->geom.h / e->config->screens.h) - h) * 1.0));
   estyle_move(es, ix, iy);
   estyle_show(es);
   sb->header = es;

   /* Build session list */
   iy = 125;
   evas_object_geometry_get(sb->listbg, &bgx, &bgy, &bgw, &bgh);
   for (l = e->config->sessions; l && iy <= 330; l = l->next)
   {
      char *session_name = ((E_Login_Session_Type *) evas_list_data(l))->name;

      es = estyle_new(evas, session_name, "raised");
      estyle_set_color(es, e->config->greeting.font.r,
                       e->config->greeting.font.g, e->config->greeting.font.b,
                       e->config->greeting.font.a);
      estyle_set_font(es, e->config->greeting.font.name,
                      e->config->greeting.font.size);
      estyle_set_layer(es, 25);
      estyle_callback_add(es, EVAS_CALLBACK_MOUSE_UP,
                          session_bar_session_clicked_cb, e);
      estyle_callback_add(es, EVAS_CALLBACK_MOUSE_IN,
                          session_bar_session_mouse_in_cb, e);
      estyle_callback_add(es, EVAS_CALLBACK_MOUSE_OUT,
                          session_bar_session_mouse_out_cb, e);
      sb->sessions = evas_list_append(sb->sessions, es);
      estyle_geometry(es, NULL, NULL, &w, &h);
      ix = ((((e->geom.w / e->config->screens.w) - w) * 0.5));
      estyle_move(es, ix, iy);
      iy += h + 5;
      bgh += h + 5;
      if (w > bgw)
      {
         bgw = w + 12;
	 ix = ((((e->geom.w / e->config->screens.w) - bgw) * 0.5));
         evas_object_move(sb->listbg, ix, 120);
      }
      evas_object_image_fill_set(sb->listbg, 0.0, 0.0, (double) bgw,
                                 (double) bgh);
      evas_object_resize(sb->listbg, bgw, bgh);
   }

   /* Bullet */
   o = evas_object_image_add(evas);
   evas_object_image_file_set(o, PACKAGE_DATA_DIR "/data/images/bullet.png",
                              NULL);
   evas_object_image_size_get(o, &iw, &ih);
   evas_object_resize(o, iw, ih);
   evas_object_image_fill_set(o, 0.0, 0.0, (double) iw, (double) ih);
   evas_object_image_alpha_set(o, 1);
   evas_object_color_set(o, e->config->greeting.font.r,
                         e->config->greeting.font.g,
                         e->config->greeting.font.b,
                         e->config->greeting.font.a);
   evas_object_layer_set(o, 15);
   evas_object_move(o, -99999, -99999);
   sb->bullet = o;

   /* Set default session to first in list (for now) */ ;
   e->xsession = evas_list_data(e->config->sessions);

   sb->win_geom.w = e->geom.w;
   sb->win_geom.h = e->geom.h;
}
示例#7
0
static inline void
_add_item(app_t *app, const char *txt)
{
    app->items = evas_list_append(app->items, strdup(txt));
}