예제 #1
0
파일: polygon.c 프로젝트: clones/kaa
PyObject *
Evas_Object_PyObject_polygon_points_clear(Evas_Object_PyObject * self, PyObject * args)
{
    BENCH_START
    evas_object_polygon_points_clear(self->object);
    BENCH_END
    return Py_INCREF(Py_None), Py_None;
}
예제 #2
0
파일: ede_gui.c 프로젝트: DaveMDS/ede
void
_circle_recalc(Evas_Object *obj, int center_x, int center_y, int radius)
{
   int x, y, r2;

   D("Circle recalc x: %d  y: %d  radius: %d", center_x, center_y, radius);
   evas_object_polygon_points_clear(obj);

   r2 = radius * radius;
   for (x = -radius; x <= radius; x += 2)
   {
      y = (int)(sqrt(r2 - x*x) + 0.5);
      evas_object_polygon_point_add(obj, center_x + x, center_y + y);
   }
   for (x = radius; x > -radius; x -= 2)
   {
      y = (int)(sqrt(r2 - x*x) + 0.5);
      evas_object_polygon_point_add(obj, center_x + x, center_y - y);
   }
}
예제 #3
0
/* This function applies the information from the Photo_Object to the actual
 * evas objects. Zoom/rotate factors and etc. */
static void
apply_changes(Photo_Object *po)
{
   Evas_Map *map;

   map = evas_map_new(4);
   evas_map_point_coord_set(map, 0, po->bx, po->by, 0);
   evas_map_point_coord_set(map, 1, po->bx + po->bw, po->by, 0);
   evas_map_point_coord_set(map, 2, po->bx + po->bw, po->by + po->bh, 0);
   evas_map_point_coord_set(map, 3, po->bx, po->by + po->bh, 0);
   evas_map_point_image_uv_set(map, 0, 0, 0);
   evas_map_point_image_uv_set(map, 1, po->bw, 0);
   evas_map_point_image_uv_set(map, 2, po->bw, po->bh);
   evas_map_point_image_uv_set(map, 3, 0, po->bh);
   evas_map_util_rotate(map, po->rotate,
         po->bx + po->bw / 2, po->by + po->bh /2);
   evas_map_util_zoom(map, po->zoom, po->zoom,
         po->bx + po->bw / 2, po->by + po->bh /2);
   evas_object_map_enable_set(po->ic, EINA_TRUE);
   evas_object_map_set(po->ic, map);

     {
        Evas_Map *shadow_map = evas_map_new(4);
        evas_map_point_coord_set(shadow_map, 0, po->bx, po->by, 0);
        evas_map_point_coord_set(shadow_map, 1, po->bx + po->bw, po->by, 0);
        evas_map_point_coord_set(shadow_map, 2,
              po->bx + po->bw, po->by + po->bh, 0);
        evas_map_point_coord_set(shadow_map, 3, po->bx, po->by + po->bh, 0);
        evas_map_point_image_uv_set(shadow_map, 0, 0, 0);
        evas_map_point_image_uv_set(shadow_map, 1, SHADOW_W, 0);
        evas_map_point_image_uv_set(shadow_map, 2, SHADOW_W, SHADOW_H);
        evas_map_point_image_uv_set(shadow_map, 3, 0, SHADOW_H);
        evas_map_util_rotate(shadow_map, po->rotate,
              po->bx + po->bw / 2, po->by + po->bh /2);
        evas_map_util_zoom(shadow_map, po->zoom * po->shadow_zoom,
              po->zoom * po->shadow_zoom,
              po->bx + (po->bw / 2), po->by + (po->bh / 2));
        evas_object_map_enable_set(po->shadow, EINA_TRUE);
        evas_object_map_set(po->shadow, shadow_map);
        evas_map_free(shadow_map);
     }

   /* Update the position of the hit box */
     {
        Evas_Coord minx, miny, maxx, maxy;
        int i;
        evas_object_polygon_points_clear(po->hit);
        evas_map_point_coord_get(map, 0, &minx, &miny, NULL);
        maxx = minx;
        maxy = miny;
        evas_object_polygon_point_add(po->hit, minx, miny);
        for (i = 1 ; i <= 3 ; i++)
          {
             Evas_Coord x, y;
             evas_map_point_coord_get(map, i, &x, &y, NULL);
             evas_object_polygon_point_add(po->hit, x, y);
             if (x < minx)
                minx = x;
             else if (x > maxx)
                maxx = x;

             if (y < miny)
                miny = y;
             else if (y > maxy)
                maxy = y;
          }
     }

   evas_object_raise(po->shadow);
   evas_object_raise(po->ic);
   evas_object_raise(po->hit);
   evas_map_free(map);
}
예제 #4
0
파일: line.c 프로젝트: playya/Enlightenment
void
_line_item_xy(Evas *e,
              Evas_Object *o,
              double x1, double y1, double x2, double y2, double w)
{
    int                 sn;
    int                 i;
    int                 is_poly = 0;

    if ((x1 == x2) && (y1 == y2))
      {
          evas_object_hide(o);
          return;
      }

    is_poly = (w > 1);

    sn = shell->segnum;
    sn = (w < sn) ? w / 2 : sn;
    if (!sn)
        sn = 1;

    if (is_poly)
      {
          double              xx1, yy1, xx2, yy2, an, x, y;

          if (x2 > x1)
            {
                xx1 = x1;
                yy1 = y1;
                xx2 = x2;
                yy2 = y2;
            }
          else
            {
                xx1 = x2;
                yy1 = y2;
                xx2 = x1;
                yy2 = y1;
            }
          if (x2 - x1 != 0.0)
            {
                an = atan((y2 - y1) / (x2 - x1)) + M_PI / 2;
            }
          else
            {
                if (y2 - y1 <= 0)
                  {
                      an = M_PI;
                  }
                else
                  {
                      an = 0;
                  }
            }
          evas_object_polygon_points_clear(o);

          for (i = 0; i < sn + 1; i++)
            {
                x = xx1 + w / 2 * cos(an + i * M_PI / sn);
                y = yy1 + w / 2 * sin(an + i * M_PI / sn);
                evas_object_polygon_point_add(o, x, y);
            }
          for (i = sn; i >= 0; i--)
            {
                x = xx2 + w / 2 * cos(an - i * M_PI / sn);
                y = yy2 + w / 2 * sin(an - i * M_PI / sn);
                evas_object_polygon_point_add(o, x, y);
            }
      }
    else
      {
          evas_object_line_xy_set(o, x1, y1, x2, y2);
      }
}
예제 #5
0
파일: Polygon.cpp 프로젝트: Limsik/e17
void Polygon::clearPoints()
{
  evas_object_polygon_points_clear( o );
}