show "add call" when there is no secondary (held) call.
authorGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Sat, 21 Jul 2012 14:54:03 +0000 (11:54 -0300)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Sat, 21 Jul 2012 14:54:03 +0000 (11:54 -0300)
Makefile.am
data/themes/images/bt_add_call_pressed.png [new file with mode: 0644]
data/themes/images/bt_add_call_released.png [new file with mode: 0644]
data/themes/includes/call.edc
dialer/callscreen.c

index aef1e6c..0d0ab11 100644 (file)
@@ -60,6 +60,8 @@ am__v_EDJ_0 = @echo "  EDJ   " $@;
 THEME_IMAGES = \
 data/themes/images/bg_call.jpg \
 data/themes/images/bg_keypad.jpg \
+data/themes/images/bt_add_call_pressed.png \
+data/themes/images/bt_add_call_released.png \
 data/themes/images/bt_add_contact_pressed.png \
 data/themes/images/bt_add_contact_released.png \
 data/themes/images/bt_backspace_pressed.png \
diff --git a/data/themes/images/bt_add_call_pressed.png b/data/themes/images/bt_add_call_pressed.png
new file mode 100644 (file)
index 0000000..28a6fae
Binary files /dev/null and b/data/themes/images/bt_add_call_pressed.png differ
diff --git a/data/themes/images/bt_add_call_released.png b/data/themes/images/bt_add_call_released.png
new file mode 100644 (file)
index 0000000..df7bec1
Binary files /dev/null and b/data/themes/images/bt_add_call_released.png differ
index 3f0a384..9d7990e 100644 (file)
@@ -43,9 +43,10 @@ group {
     *     2 - FLOAT: microphone volume 0.0-1.0
     *     3 - FLOAT: elapsed time in seconds (> 0.0)
     *
-    * Where <ID> is: numbers 0 to 9, star, hash, mute, keypad, speaker,
-    * merge, swap, contacts, answer, hangup, waiting-hangup, hold-answer,
-    * hangup-answer, multiparty, held-multiparty, multiparty-details
+    * Where <ID> is: numbers 0 to 9, star, hash, mute, keypad,
+    * speaker, add-call, merge, swap, contacts, answer, hangup,
+    * waiting-hangup, hold-answer, hangup-answer, multiparty,
+    * held-multiparty, multiparty-details
     *
     * Where <STATE> is: disconnected, active, held, dialing, alerting,
     * incoming, waiting.
@@ -61,6 +62,8 @@ group {
       image: "bt_keypad_released.png" COMP;
       image: "bt_speaker_pressed.png" COMP;
       image: "bt_speaker_released.png" COMP;
+      image: "bt_add_call_pressed.png" COMP;
+      image: "bt_add_call_released.png" COMP;
       image: "bt_merge_pressed.png" COMP;
       image: "bt_merge_released.png" COMP;
       image: "bt_swap_pressed.png" COMP;
@@ -816,6 +819,128 @@ group {
          }                                                              \
       }
 
+#define ACTION_HIDEABLE(id, img, r1, r2)                                \
+      part {                                                            \
+         name: "clipper."##id;                                          \
+         type: RECT;                                                    \
+         clip_to: "clipper.actions";                                    \
+         description {                                                  \
+            state: "default" 0.0;                                       \
+            color: 255 255 255 255;                                     \
+            rel1.to: "button."##id;                                     \
+            rel2.to: "button."##id;                                     \
+         }                                                              \
+         description {                                                  \
+            state: "hidden" 0.0;                                        \
+            inherit: "default" 0.0;                                     \
+            color: 255 255 255 0;                                       \
+            visible: 0;                                                 \
+         }                                                              \
+      }                                                                 \
+      part {                                                            \
+         name: "button."##id;                                           \
+         type: IMAGE;                                                   \
+         mouse_events: 1;                                               \
+         clip_to: "clipper."##id;                                       \
+         description {                                                  \
+            state: "default" 0.0;                                       \
+            color: 255 255 255 255;                                     \
+            color_class: "action";                                      \
+            min: 240 170;                                               \
+            max: 240 170;                                               \
+            fixed: 1 1;                                                 \
+            rel1 {                                                      \
+               to: "bg.actions";                                        \
+               relative: r1;                                            \
+            }                                                           \
+            rel2 {                                                      \
+               to: "bg.actions";                                        \
+               relative: r2;                                            \
+               offset: -1 -1;                                           \
+            }                                                           \
+            image.normal: "bt_"##img"_released.png";                    \
+         }                                                              \
+         description {                                                  \
+            state: "pressed" 0.0;                                       \
+            inherit: "default" 0.0;                                     \
+            color: 255 255 255 0;                                       \
+            visible: 0;                                                 \
+         }                                                              \
+      }                                                                 \
+      part {                                                            \
+         name: "button.over."##id;                                      \
+         type: IMAGE;                                                   \
+         clip_to: "clipper."##id;                                       \
+         mouse_events: 0;                                               \
+         description {                                                  \
+            state: "default" 0.0;                                       \
+            color: 255 255 255 0;                                       \
+            visible: 0;                                                 \
+            color_class: "action";                                      \
+            rel1.to: "button."##id;                                     \
+            rel2.to: "button."##id;                                     \
+            image.normal: "bt_"##img"_pressed.png";                     \
+         }                                                              \
+         description {                                                  \
+            state: "pressed" 0.0;                                       \
+            inherit: "default" 0.0;                                     \
+            color: 255 255 255 255;                                     \
+            visible: 1;                                                 \
+         }                                                              \
+      }                                                                 \
+      programs {                                                        \
+         program {                                                      \
+            signal: "mouse,up,1";                                       \
+            source: "button."##id;                                      \
+            action: SIGNAL_EMIT "released,"##id "call";                 \
+            after: "show_up_"##id;                                      \
+            api: id"_released" id" was released";                       \
+         }                                                              \
+         program {                                                      \
+            name: "show_up_"##id;                                       \
+            action: STATE_SET "default" 0.0;                            \
+            transition: DECELERATE 0.1;                                 \
+            target: "button."##id;                                      \
+            target: "button.over."##id;                                 \
+         }                                                              \
+         program {                                                      \
+            signal: "mouse,down,1";                                     \
+            source: "button."##id;                                      \
+            after: "show_down_"##id;                                    \
+            action: SIGNAL_EMIT "pressed,"##id "call";                  \
+            api: id"_pressed" id" was pressed";                         \
+         }                                                              \
+         program {                                                      \
+            name: "show_down_"##id;                                     \
+            action: STATE_SET "pressed" 0.0;                            \
+            transition: ACCELERATE 0.1;                                 \
+            target: "button."##id;                                      \
+            target: "button.over."##id;                                 \
+         }                                                              \
+         program {                                                      \
+            signal: "mouse,clicked,1";                                  \
+            source: "button."##id;                                      \
+            action: SIGNAL_EMIT "clicked,"##id "call";                  \
+            api: id"_clicked" id" was clicked";                         \
+         }                                                              \
+         program {                                                      \
+            name: "hide_"##id;                                          \
+            signal: "hide,"##id;                                        \
+            source: "call";                                             \
+            action: STATE_SET "hidden" 0.0;                             \
+            target: "clipper."##id;                                     \
+            api: id"_hide" "hide "##id;                                 \
+         }                                                              \
+         program {                                                      \
+            name: "show_"##id;                                          \
+            signal: "show,"##id;                                        \
+            source: "call";                                             \
+            action: STATE_SET "default" 0.0;                            \
+            target: "clipper."##id;                                     \
+            api: id"_show" "show "##id;                                 \
+         }                                                              \
+      }
+
 #define ACTION_TOGGLE(id, img, r1, r2)                                  \
       part {                                                            \
          name: "clipper."##id;                                          \
@@ -1024,7 +1149,9 @@ group {
       ACTION_BUTTON("keypad",  "keypad",  0.333333333 0.0, 0.666666666 0.5);
       ACTION_TOGGLE("speaker", "speaker", 0.666666666 0.0, 1.000000000 0.5);
 
-      ACTION_BUTTON("merge",    "merge",  0.000000000 0.5, 0.333333333 1.0);
+      ACTION_HIDEABLE("merge",    "merge",  0.000000000 0.5, 0.333333333 1.0);
+      ACTION_HIDEABLE("add-call", "add_call",0.000000000 0.5, 0.333333333 1.0);
+
       ACTION_BUTTON("swap",     "swap",   0.333333333 0.5, 0.666666666 1.0);
       ACTION_BUTTON("contacts", "contacts",0.666666666 0.5, 1.000000000 1.0);
 #undef ACTION_BUTTON
@@ -1033,6 +1160,21 @@ group {
       SEPARATOR("answer", "clipper.answer", 0.0, -8, "button.answer");
       SEPARATOR("hangup", "clipper.multiparty-details-hidden", 0.0, -8, "button.hangup");
 
+      programs {
+         program {
+            signal: "enable,merge";
+            source: "call";
+            after: "hide_add-call";
+            after: "show_merge";
+         }
+         program {
+            signal: "disable,merge";
+            source: "call";
+            after: "show_add-call";
+            after: "hide_merge";
+         }
+      }
+
       part {
          name: "clipper.keypad-hidden";
          type: RECT;
index be75510..99eb53e 100644 (file)
@@ -427,6 +427,8 @@ static void _on_clicked(void *data, Evas_Object *obj __UNUSED__,
                ERR("TODO - implement platform loudspeaker code");
        } else if (strcmp(emission, "contacts") == 0) {
                ERR("TODO - implement access to contacts");
+       } else if (strcmp(emission, "add-call") == 0) {
+               gui_call_exit();
        } else if (strcmp(emission, "merge") == 0) {
                if (ctx->calls.held)
                        ofono_multiparty_create(NULL, NULL);