This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository elimine.

View the commit online.

commit 319bdfc6956d8297d9ef28852390f5106b0d2e6a
Author: Vincent Torri <vto...@outlook.fr>
AuthorDate: Tue Jul 8 06:21:08 2025 +0200

    add smileys
---
 src/bin/elimine.c | 13 +++++++++++++
 src/bin/icon.c    | 37 +++++++++++++++++++++++++++++++++++++
 src/bin/icon.h    | 13 +++++++++++++
 3 files changed, 63 insertions(+)

diff --git a/src/bin/elimine.c b/src/bin/elimine.c
index 21240e5..453f895 100644
--- a/src/bin/elimine.c
+++ b/src/bin/elimine.c
@@ -404,6 +404,19 @@ elm_main(int argc, char **argv)
     elm_box_pack_end(hbox, o);
     evas_object_show(o);
 
+    o = evas_object_image_add(evas_object_evas_get(win));
+    smiley_size_get(&icon_w, &icon_h);
+    icon_w *= ctx->tile_sz;
+    icon_h *= ctx->tile_sz;
+    evas_object_image_size_set(o, icon_w, icon_h);
+    evas_object_image_fill_set(o, 0, 0, icon_w, icon_h);
+    evas_object_image_data_set(o, smiley_bmp_get(SMILEY_WIN));
+    evas_object_resize(o, icon_w, icon_h);
+    evas_object_size_hint_min_set(o, icon_w, icon_h);
+    evas_object_size_hint_max_set(o, icon_w, icon_h);
+    elm_box_pack_end(hbox, o);
+    evas_object_show(o);
+
     /* table */
     o = elm_table_add(win);
     elm_table_homogeneous_set(o, EINA_TRUE);
diff --git a/src/bin/icon.c b/src/bin/icon.c
index a6a3121..80f9581 100644
--- a/src/bin/icon.c
+++ b/src/bin/icon.c
@@ -50,14 +50,26 @@ static Offset tile_offset[TILE_COUNT] =
     { 48, 48 }, /* bomb exploded */
 };
 
+static Offset smiley_offset[SMILEY_COUNT] =
+{
+    { 28, 0  }, /* normal */
+    { 28, 28 }, /* clicked */
+    { 0,  0  }, /* lost */
+    { 0,  28 }, /* win */
+};
+
 static int cipher_size[2] = { 16, 32 };
 
 static int tile_size[2] = { 16, 16 };
 
+static int smiley_size[2] = { 28, 28 };
+
 static unsigned int **cipher_bmp = { 0 };
 
 static unsigned int **tile_bmp = { 0 };
 
+static unsigned int **smiley_bmp = { 0 };
+
 typedef struct Icon Icon;
 
 struct Icon
@@ -176,6 +188,20 @@ Eina_Bool icon_init(Evas_Object *win, int tile_sz)
 
     tile_bmp = icon_create(win, &ic);
 
+    eina_strbuf_reset(buf);
+    if (!eina_strbuf_append(buf, PACKAGE_PKGDATA_DIR "/images/smileys.png"))
+        goto free_buf;
+
+    ic.buf = buf;
+    ic.offset = smiley_offset;
+    ic.data = ""
+    ic.w = smiley_size[0];
+    ic.h = smiley_size[1];
+    ic.nbr = SMILEY_COUNT;
+    ic.tile_sz = tile_sz;
+
+    smiley_bmp = icon_create(win, &ic);
+
     ret = EINA_TRUE;
 
   free_buf:
@@ -204,3 +230,14 @@ unsigned int *tile_bmp_get(Tile_Type t)
 {
     return tile_bmp[t];
 }
+
+void smiley_size_get(int *w, int *h)
+{
+    if (w) *w = smiley_size[0];
+    if (h) *h = smiley_size[1];
+}
+
+unsigned int *smiley_bmp_get(Smiley_Type t)
+{
+    return smiley_bmp[t];
+}
diff --git a/src/bin/icon.h b/src/bin/icon.h
index f765414..c6e0c04 100644
--- a/src/bin/icon.h
+++ b/src/bin/icon.h
@@ -41,6 +41,15 @@ typedef enum
     TILE_COUNT
 } Tile_Type;
 
+typedef enum
+{
+    SMILEY_NORMAL,
+    SMILEY_CLICKED,
+    SMILEY_LOST,
+    SMILEY_WIN,
+    SMILEY_COUNT
+} Smiley_Type;
+
 Eina_Bool icon_init(Evas_Object *win, int tile_sz);
 
 void cipher_size_get(int *w, int *h);
@@ -51,5 +60,9 @@ void tile_size_get(int *w, int *h);
 
 unsigned int *tile_bmp_get(Tile_Type t);
 
+void smiley_size_get(int *w, int *h);
+
+unsigned int *smiley_bmp_get(Smiley_Type t);
+
 
 #endif /* ICON_H */

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to