コード例 #1
0
ファイル: pager.c プロジェクト: Limsik/e17
void
on_number_button_enter(void *data, Evas_Object *obj, const char *emission,
                       const char *source)
{
   Measurements_Lists *ml = data;
   ml = data;
   float n_in, n_out;
   int m_in, m_out;
   char label_in[128], label_out[128];
   char result[64];
   Elm_Object_Item *list_it_in, *list_it_out;
   list_it_in = elm_list_selected_item_get(ml->list_in);
   list_it_out = elm_list_selected_item_get(ml->list_out);

   if (!list_it_in || !list_it_out ||
       !strcmp((edje_object_part_text_get(obj, "input")), ""))
     {
        edje_object_part_text_set(obj, "input", "");
        edje_object_part_text_set(obj, "output", "");
        return;
     }

   edje_object_part_text_set(obj, "equal", "=");
   snprintf(label_in, sizeof(label_in), "%s",
            elm_object_item_text_get(list_it_in));
   snprintf(label_out, sizeof(label_out), "%s",
            elm_object_item_text_get(list_it_out));

   if (!strcmp(label_in, KM_LABEL)) {
	m_in = KILOMETER;
   } else if(!strcmp(label_in, M_LABEL)) {
	m_in = METER;
   } else if(!strcmp(label_in, CM_LABEL)) {
	m_in = CENTIMETER;
   }

   if (!strcmp(label_out, KM_LABEL))
     m_out = KILOMETER;
   else if(!strcmp(label_out, M_LABEL))
     m_out = METER;
   else if(!strcmp(label_out, CM_LABEL))
     m_out = CENTIMETER;

   n_in = atof(edje_object_part_text_get(obj, "input"));
   n_out = converter(n_in, m_in, m_out);

   snprintf(result, sizeof(result), "%f", n_out);
   edje_object_part_text_set(obj, "output", result);
}
コード例 #2
0
ファイル: url_bar.c プロジェクト: harlanlewis/webkit
static char *
_url_bar_url_get_with_protocol(Url_Bar *urlBar)
{
    const char *url = edje_object_part_text_get(urlBar->entry, "url.text");

    return url_from_user_input(url);
}
コード例 #3
0
void _eli_edje_frontend_new_game_cb(void * data, Evas_Object * o, const char * emission,
                          const char * source)
{
    Eli_App * eap;
    Eli_Edje_Frontend * eef;

    eap = (Eli_App *) data;
    eef = eli_app_edje_frontend_get(eap);

    if (!strcmp(source, "")) {
        if (eap->current.game) {
            eli_app_game_new(eap, eap->current.game);
        }
        else return;
    }
    else if (strcmp(source, "item_selected")) eli_app_game_new(eap, emission);
    else {
        const char * game;

        game = edje_object_part_text_get(o, "elitaire_element_value");
        if (game) {
            edje_object_signal_emit(eef->gui, "game,selected", "elitaire");
            eli_app_game_new(eap, game);
        }
    }
}
コード例 #4
0
static void
_label_sliding_change(Evas_Object *obj)
{
   char *plaintxt;
   int plainlen = 0;

   ELM_LABEL_DATA_GET(obj, sd);

   // doesn't support multiline sliding effect
   if (sd->linewrap)
     {
        sd->slidingmode = EINA_FALSE;
        return;
     }

   plaintxt = _elm_util_mkup_to_text
       (edje_object_part_text_get
         (ELM_WIDGET_DATA(sd)->resize_obj, "elm.text"));
   if (plaintxt != NULL)
     {
        plainlen = strlen(plaintxt);
        free(plaintxt);
     }
   // too short to slide label
   if (plainlen < 1)
     {
        sd->slidingmode = EINA_TRUE;
        return;
     }

   if (sd->slidingmode)
     {
        Edje_Message_Float_Set *msg =
          alloca(sizeof(Edje_Message_Float_Set) + (sizeof(double)));

        if (sd->ellipsis)
          {
             sd->slidingellipsis = EINA_TRUE;
             elm_label_ellipsis_set(obj, EINA_FALSE);
          }

        msg->count = 1;
        msg->val[0] = sd->slide_duration;

        edje_object_message_send
          (ELM_WIDGET_DATA(sd)->resize_obj, EDJE_MESSAGE_FLOAT_SET, 0, msg);
        edje_object_signal_emit
          (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,slide,start", "elm");
     }
   else
     {
        edje_object_signal_emit
          (ELM_WIDGET_DATA(sd)->resize_obj, "elm,state,slide,stop", "elm");
        if (sd->slidingellipsis)
          {
             sd->slidingellipsis = EINA_FALSE;
             elm_label_ellipsis_set(obj, EINA_TRUE);
          }
     }
}
コード例 #5
0
static void
_enscribi_input_frame_cb_finished(void *data, Evas_Object *obj, const char *emission, const char *source)
{
    Smart_Data *sd;
    Edje_Message_String msg;
    char *str;

    sd = data;

    msg.str = edje_object_part_text_get(obj, "result");
    if (msg.str && strlen(msg.str) > 0) {
        printf("Result: %s\n", msg.str);
        if (sd->parent)
            edje_object_message_send(sd->parent, EDJE_MESSAGE_STRING, 188, &msg);

        evas_object_smart_callback_call(sd->obj, "input,selected", edje_object_part_text_get(obj, "result"));
    }
    edje_object_part_text_set(obj, "result", "");
}
コード例 #6
0
ファイル: pager.c プロジェクト: Limsik/e17
void
on_number_button_clicked(void *data, Evas_Object *obj, const char *emission,
				const char *source)
{
   const char *n = data;
   char buf[1024];
   int aux;
   int current = atoi(edje_object_part_text_get(obj, "input"));

   aux = atoi(n);
   aux += current*10;
   snprintf(buf, sizeof(buf), "%d", aux);

   edje_object_part_text_set(obj, "input", buf);
}
コード例 #7
0
const char* EdjePart::text() const
{
    return edje_object_part_text_get( _parent->obj(), _partname );
}