/* vim: set sw=3 ts=3 sts=3 expandtab: */
group {
   name: "ecdb/entry";
   min: 18 18;
   
   styles {
      style {
         name: "entry_default";
         base: "font=ecdb/default font_size=11 align=left color=#000 wrap=none";
         tag: "br" "\n";
         tag: "tab" "\t";
         tag: "hilight" "+ font=Sans:style:Bold";
         // Need any more tags?
      }
   }

   parts {
      part {
         name: "entry";

         description {
            state: "default" 0.0;

            image {
               normal: "entry.png";
               border: 6 6 8 7;
            }
         }
      
         description {
            state: "disabled" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 128;
         }
      }

      part {
         name: "entry_focus";
         
         description {
            state: "default" 0.0;
            color: 255 255 255 0;
            
            image {
               normal: "entry_focus.png";
               border: 7 7 8 7;
               middle: 0;
            }

            fill {
               smooth: 0;
            }
         }

         description {
            state: "focused" 0.0;
            inherit: "default" 0.0;
            color: 255 255 255 255;
         }
      }

      part {
         name: "ecdb.text";
         type: TEXTBLOCK;
         mouse_events: 1;
         entry_mode: EDITABLE;
         multiline: 0;
         source2: "entry/selection/default";
         //source3: "entry/cursor/default";
         source3: "entry/selection/default";
         
         description {
            state: "default" 0.0;
            text {
               style: "entry_default";
               min: 1 1;
            }

            rel1 {
               to: "entry";
               offset: 5 3;
            }

            rel2 {
               to: "entry";
               offset: -2 -2;
            }
         }
      }
   }

   programs {
      program {
         name: "focus_set";
         action: FOCUS_SET;
         target: "ecdb.text";
      }

      program {
         name: "focus_in,mouse";
         action: STATE_SET "focused" 0.0;
         signal: "mouse,down,*";
         source: "*";
         target: "entry_focus";
         transition: DECELERATE 0.5;
         after: "focus_set";
      }

      program {
         name: "signal_emit";
         signal: "mouse,clicked,1";
         action: SIGNAL_EMIT "clicked" "ecdb";
         source: "*";
      }

      program {
         name: "focus_in,ecdb";
         action: STATE_SET "focused" 0.0;
         signal: "ecdb,focus,in";
         source: "ecdb";
         target: "entry_focus";
         transition: DECELERATE 0.5;
         after: "focus_set";
      }

      program {
         name: "focus_out";
         signal: "ecdb,focus,out";
         action: STATE_SET "default" 0.0;
         source: "ecdb";
         target: "entry_focus";
         transition: DECELERATE 0.5;
      }

      program {
         name: "disable";
         signal: "ecdb,disable";
         action: STATE_SET "disabled" 0.0;
         source: "ecdb";
         target: "entry";
      }

      program {
         name: "enable";
         signal: "ecdb,enable";
         action: STATE_SET "default" 0.0;
         source: "ecdb";
         target: "entry";
      }
   }
}

/*
group {
   name: "entry/cursor/default";

   parts {
      part {
         name: "cursor";
         type: RECT;
         mouse_events: 0;

         description {
            state: "default" 0.0;
            color: 0 0 0 255;
            min: 1 1;
            max: 1 999999;
            rel1 {
               relative: 0.0 0.0;
               offset: -1 2;
            }

            rel2 {
               relative: 0.0 1.0;
               offset: -1 -1;
            }
         }
      }
   }
}
*/

group {
   name: "entry/selection/default";
   parts {
      part {
         name: "selection";
         type: RECT;
         mouse_events: 0;

         description {
            state: "default" 0.0;
            color: 138 171 225 128;

            rel1 {
               relative: 0.0 0.0;
               offset: 0 2;
            }
            rel2 {
               relative: 1.0 1.0;
               offset: -1 -1;
            }
         }
      }
   }
}
