예제 #1
0
void
image_tweenlist_populate(void)
{
   Eina_List *tweens, *l;
   Etk_Tree_Col *col;

   if (!etk_string_length_get(Cur.state)) return;
   if (!etk_string_length_get(Cur.part)) return;

   col = etk_tree_nth_col_get(ETK_TREE(UI_ImageTweenList), 0);

   etk_tree_clear(ETK_TREE(UI_ImageTweenList));

   tweens = l = edje_edit_state_tweens_list_get(edje_o, Cur.part->string, Cur.state->string);
   while (l)
   {
      //printf("RET: %s (id: %d)\n", l->data, edje_edit_image_id_get(edje_o, l->data));
      //snprintf(buf, sizeof(buf), "images/%d", edje_edit_image_id_get(edje_o, l->data)); TODO: find a way to append image directly from the edje file.
      etk_tree_row_append(ETK_TREE(UI_ImageTweenList), NULL,
                          col, NULL, NULL, l->data,
                          NULL);
      l = l->next;
   }
   edje_edit_string_list_free(tweens);
}
예제 #2
0
Etk_Bool
_gradient_RelSpinners_value_changed_cb(Etk_Range *range, double value, void *data)
{
   printf("Value Changed Signal on Gradient RelSpinner EMITTED (value: %f)\n",etk_range_value_get(range));

   if (!etk_string_length_get(Cur.state) || !etk_string_length_get(Cur.part))
      return ETK_TRUE;

   switch ((int)(long)data)
   {
      case REL1X_SPINNER:
         edje_edit_state_gradient_rel1_relative_x_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL1Y_SPINNER:
         edje_edit_state_gradient_rel1_relative_y_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL2X_SPINNER:
         edje_edit_state_gradient_rel2_relative_x_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL2Y_SPINNER:
         edje_edit_state_gradient_rel2_relative_y_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL1XO_SPINNER:
         edje_edit_state_gradient_rel1_offset_x_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL1YO_SPINNER:
         edje_edit_state_gradient_rel1_offset_y_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL2XO_SPINNER:
         edje_edit_state_gradient_rel2_offset_x_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
      case REL2YO_SPINNER:
         edje_edit_state_gradient_rel2_offset_y_set(edje_o, 
                                 Cur.part->string, Cur.state->string,
                                 etk_range_value_get(range));
         break;
   }
   canvas_redraw();
   return ETK_TRUE;
}
예제 #3
0
Etk_Bool
_image_AlphaSlider_value_changed_cb(Etk_Object *object, double va, void *data)
{
   printf("ImageSlieder value_changed signale EMIT: %.2f\n",va);

   if (!etk_string_length_get(Cur.state)) return ETK_TRUE;
   if (!etk_string_length_get(Cur.part)) return ETK_TRUE;
   edje_edit_state_color_set(edje_o, Cur.part->string, Cur.state->string,
                             -1, -1, -1, (int)va);
   canvas_redraw();

   return ETK_TRUE;
}
예제 #4
0
/* Image Browser Callbacks */
Etk_Bool
_image_browser_iconbox_selected_cb(Etk_Iconbox *iconbox, Etk_Iconbox_Icon *icon, void *data)
{
   const char *image;
   image = etk_iconbox_icon_label_get(icon);

   printf("CLICK ON: %s :)\n", image);
   if (ImageBroserUpdate && etk_string_length_get(Cur.part) && etk_string_length_get(Cur.state))
     {
        edje_edit_state_image_set(edje_o, Cur.part->string, Cur.state->string, image);
     }
   image_frame_update();

   return ETK_TRUE;
}
예제 #5
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;
}
예제 #6
0
Etk_Bool
_image_border_spinners_value_changed_cb(Etk_Range *range, double value, void *data)
{
   printf("Value Changed signal on BorderSpinner EMITTED (value: %f)\n",etk_range_value_get(range));

   if (!etk_string_length_get(Cur.state)) return ETK_TRUE;
   if (!etk_string_length_get(Cur.part)) return ETK_TRUE;
   edje_edit_state_image_border_set(edje_o, Cur.part->string, Cur.state->string,
      (int)etk_range_value_get(ETK_RANGE(UI_BorderLeftSpinner)),
      (int)etk_range_value_get(ETK_RANGE(UI_BorderRightSpinner)),
      (int)etk_range_value_get(ETK_RANGE(UI_BorderTopSpinner)),
      (int)etk_range_value_get(ETK_RANGE(UI_BorderBottomSpinner)));

   canvas_redraw();

   return ETK_TRUE;
}
예제 #7
0
Etk_Bool
_state_EntryImage_clicked_cb(Etk_Object *object, void *data)
{
   const char *name;

   printf("Mouse Click Signal on StateEntryImage Emitted\n");

   name = etk_entry_text_get(ETK_ENTRY(UI_StateEntry));

   if (!name || !etk_string_length_get(Cur.state)) return ETK_TRUE;

   if (!strcmp(name, Cur.state->string))
   {
      etk_widget_hide(ETK_WIDGET(UI_StateEntryImage));
      return ETK_TRUE;
   }

   /* Change state name */
   if (strcmp("default 0.00", Cur.state->string))
   {
      if (edje_edit_state_name_set(edje_o, Cur.part->string, Cur.state->string, name))
      {
         /* update tree */
         Etk_Tree_Row *row;
         row = etk_tree_selected_row_get(ETK_TREE(UI_PartsTree));
         etk_tree_row_fields_set(row,TRUE,
                                    COL_NAME, EdjeFile, "DESC.PNG", name,
                                    NULL);
         /* update Cur */
         Cur.state = etk_string_set(Cur.state, name);
         /* Hide the entry image */
         etk_widget_hide(ETK_WIDGET(UI_StateEntryImage));
      }
      else
         dialog_alert_show("<b>Wrong name format</b><br>Name must be in the form:<br>\"default 0.00\"");
   }
   else
      dialog_alert_show("You can't rename default 0.0");

   return ETK_TRUE;
}
예제 #8
0
void
image_frame_update(void)
{
   //Etk_Combobox_Item *item = NULL;
   const char *im;

   //Stop signal propagation
   etk_signal_block("value-changed",ETK_OBJECT(UI_BorderLeftSpinner),
                    ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                    (void*)BORDER_LEFT);
   etk_signal_block("value-changed",ETK_OBJECT(UI_BorderRightSpinner),
                    ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                    (void*)BORDER_RIGHT);
   etk_signal_block("value-changed",ETK_OBJECT(UI_BorderTopSpinner),
                    ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                    (void*)BORDER_TOP);
   etk_signal_block("value-changed",ETK_OBJECT(UI_BorderBottomSpinner),
                    ETK_CALLBACK(_image_border_spinners_value_changed_cb),
                    (void*)BORDER_BOTTOM);
   etk_signal_block("value-changed",ETK_OBJECT(UI_ImageAlphaSlider),
                    ETK_CALLBACK(_image_AlphaSlider_value_changed_cb), NULL);
   etk_signal_block("icon-selected", ETK_OBJECT(UI_ImageBrowserIconbox),
                    ETK_CALLBACK(_image_browser_iconbox_selected_cb), NULL);
   etk_signal_block("toggled", ETK_OBJECT(UI_BorderMiddleCheck),
                    ETK_CALLBACK(_image_BorderMiddleCheck_toggled_cb), NULL);

   if (!etk_string_length_get(Cur.state)) return;
   if (!etk_string_length_get(Cur.part)) return;

   image_tweenlist_populate();
   etk_widget_disabled_set(UI_DeleteTweenButton, TRUE);
   etk_widget_disabled_set(UI_MoveDownTweenButton, TRUE);
   etk_widget_disabled_set(UI_MoveUpTweenButton, TRUE);

   /* Update Image Browser */
   image_browser_update();

   //Set the images label for normal image
   im = edje_edit_state_image_get(edje_o, Cur.part->string, Cur.state->string);
   if (im)
   {
      etk_label_set(ETK_LABEL(UI_ImageNameLabel), im);
      edje_edit_string_free(im);
   }
   else
   {
      etk_label_set(ETK_LABEL(UI_ImageNameLabel), "none");
   }

   //Set alpha and borders
   int alpha, t, l, r, b;
   edje_edit_state_color_get(edje_o, Cur.part->string, Cur.state->string,
                             NULL, NULL, NULL, &alpha);
   edje_edit_state_image_border_get(edje_o, Cur.part->string, Cur.state->string,
                                    &l, &r, &t, &b);
   etk_range_value_set(ETK_RANGE(UI_ImageAlphaSlider), alpha);
   etk_range_value_set(ETK_RANGE(UI_BorderLeftSpinner), l);
   etk_range_value_set(ETK_RANGE(UI_BorderRightSpinner), r);
   etk_range_value_set(ETK_RANGE(UI_BorderTopSpinner), t);
   etk_range_value_set(ETK_RANGE(UI_BorderBottomSpinner), b);
   etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(UI_BorderMiddleCheck),
         edje_edit_state_image_border_fill_get(edje_o, Cur.part->string,
                                                      Cur.state->string));

   //ReEnable Signal Propagation
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderLeftSpinner),
                      _image_border_spinners_value_changed_cb,
                      (void*)BORDER_LEFT);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderRightSpinner),
                      _image_border_spinners_value_changed_cb,
                      (void*)BORDER_RIGHT);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderTopSpinner),
                      _image_border_spinners_value_changed_cb,
                      (void*)BORDER_TOP);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_BorderBottomSpinner),
                      _image_border_spinners_value_changed_cb,
                      (void*)BORDER_BOTTOM);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_ImageAlphaSlider),
                      _image_AlphaSlider_value_changed_cb, NULL);
   etk_signal_unblock("icon-selected", ETK_OBJECT(UI_ImageBrowserIconbox),
                      ETK_CALLBACK(_image_browser_iconbox_selected_cb), NULL);
   etk_signal_unblock("toggled", ETK_OBJECT(UI_BorderMiddleCheck),
                      ETK_CALLBACK(_image_BorderMiddleCheck_toggled_cb), NULL);
}
예제 #9
0
void
state_frame_update(void)
{
   const char* cc;
   
   //Stop signal propagation
   etk_signal_block("text-changed", ETK_OBJECT(UI_StateEntry),
                    _group_NamesEntry_text_changed_cb, NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_AspectMinSpinner),
                    ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_AspectMaxSpinner),
                    ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL);
   etk_signal_block("active-item-changed", ETK_OBJECT(UI_AspectComboBox),
                    ETK_CALLBACK(_state_AspectComboBox_changed_cb), NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_StateMinWSpinner),
                    ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_StateMinHSpinner),
                    ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_StateMaxWSpinner),
                    ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_StateMaxHSpinner),
                    ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_block("value-changed", ETK_OBJECT(UI_StateAlignVSpinner),
                    ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb),
                    (void*)STATE_ALIGNV_SPINNER);
   etk_signal_block("value-changed", ETK_OBJECT(UI_StateAlignHSpinner),
                    ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb),
                    (void*)STATE_ALIGNH_SPINNER);
   etk_signal_block("toggled", ETK_OBJECT(UI_StateVisibleCheck),
                    ETK_CALLBACK(_state_VisibleCheck_toggled_cb), NULL);
   etk_signal_block("text-changed", ETK_OBJECT(UI_StateCCEntry),
                    ETK_CALLBACK(_state_CCEntry_text_changed_cb), NULL);

   if (etk_string_length_get(Cur.state))
   {
      //Set description name & index
      etk_entry_text_set(ETK_ENTRY(UI_StateEntry),Cur.state->string);
      etk_widget_hide(ETK_WIDGET(UI_StateEntryImage));
      if (!strcmp(Cur.state->string, "default 0.00"))
         etk_widget_disabled_set(ETK_WIDGET(UI_StateEntry), ETK_TRUE);
      else
         etk_widget_disabled_set(ETK_WIDGET(UI_StateEntry), ETK_FALSE);

      //Set aspect min & max
      etk_range_value_set(ETK_RANGE(UI_AspectMinSpinner),
         edje_edit_state_aspect_min_get(edje_o, Cur.part->string, Cur.state->string));
      etk_range_value_set(ETK_RANGE(UI_AspectMaxSpinner),
         edje_edit_state_aspect_max_get(edje_o, Cur.part->string, Cur.state->string));

      //Set aspect pref Combo
      etk_combobox_active_item_set(ETK_COMBOBOX(UI_AspectComboBox),
         etk_combobox_nth_item_get(ETK_COMBOBOX(UI_AspectComboBox), 
            edje_edit_state_aspect_pref_get(edje_o, Cur.part->string, Cur.state->string)));

      //Set min e max size
      etk_range_value_set(ETK_RANGE(UI_StateMinWSpinner),
         edje_edit_state_min_w_get(edje_o, Cur.part->string, Cur.state->string));
      etk_range_value_set(ETK_RANGE(UI_StateMinHSpinner),
         edje_edit_state_min_h_get(edje_o, Cur.part->string, Cur.state->string));
      etk_range_value_set(ETK_RANGE(UI_StateMaxWSpinner),
         edje_edit_state_max_w_get(edje_o, Cur.part->string, Cur.state->string));
      etk_range_value_set(ETK_RANGE(UI_StateMaxHSpinner),
         edje_edit_state_max_h_get(edje_o, Cur.part->string, Cur.state->string));

      //Set description align & valign
      etk_range_value_set(ETK_RANGE(UI_StateAlignHSpinner),
         edje_edit_state_align_x_get(edje_o, Cur.part->string, Cur.state->string));
      etk_range_value_set(ETK_RANGE(UI_StateAlignVSpinner),
         edje_edit_state_align_y_get(edje_o, Cur.part->string, Cur.state->string));

      //Set visible checkbox
      etk_toggle_button_active_set(ETK_TOGGLE_BUTTON(UI_StateVisibleCheck),
         edje_edit_state_visible_get(edje_o, Cur.part->string, Cur.state->string));
      
      //Set Color Class Entry
      cc = edje_edit_state_color_class_get(edje_o, Cur.part->string, Cur.state->string);
      etk_entry_text_set(ETK_ENTRY(UI_StateCCEntry), cc);
      edje_edit_string_free(cc);
   }

   //ReEnable Signal Propagation
   etk_signal_unblock("text-changed", ETK_OBJECT(UI_StateEntry),
                      _group_NamesEntry_text_changed_cb, NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_AspectMinSpinner),
                      ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_AspectMaxSpinner),
                      ETK_CALLBACK(_state_AspectSpinner_value_changed_cb), NULL);
   etk_signal_unblock("active-item-changed", ETK_OBJECT(UI_AspectComboBox),
                      ETK_CALLBACK(_state_AspectComboBox_changed_cb), NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMinWSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMinHSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMaxWSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateMaxHSpinner),
                      ETK_CALLBACK(_state_MinMaxSpinner_value_changed_cb), NULL);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateAlignVSpinner),
                      ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb),
                      (void*)STATE_ALIGNV_SPINNER);
   etk_signal_unblock("value-changed", ETK_OBJECT(UI_StateAlignHSpinner),
                      ETK_CALLBACK(_text_FontAlignSpinner_value_changed_cb),
                      (void*)STATE_ALIGNH_SPINNER);
   etk_signal_unblock("toggled", ETK_OBJECT(UI_StateVisibleCheck),
                      ETK_CALLBACK(_state_VisibleCheck_toggled_cb), NULL);
   etk_signal_unblock("text-changed", ETK_OBJECT(UI_StateCCEntry),
                      ETK_CALLBACK(_state_CCEntry_text_changed_cb), NULL);

}