Vim styleguides, small theme fix, be a bit more robust when handling random strings as image burning input.

This commit is contained in:
Jaime Thomas 2008-12-09 19:46:00 +00:00
parent ad7c7344cf
commit 8cbc349d13
21 changed files with 191 additions and 160 deletions

View File

@ -1,176 +1,176 @@
group { group {
name: "ecdb/entry"; name: "ecdb/entry";
min: 18 18; min: 18 18;
styles { styles {
style { style {
name: "entry_default"; name: "entry_default";
base: "font=ecdb/default font_size=11 align=left color=#000 wrap=none"; base: "font=ecdb/default font_size=11 align=left color=#000 wrap=none";
tag: "br" "\n"; tag: "br" "\n";
tag: "tab" "\t"; tag: "tab" "\t";
tag: "hilight" "+ font=Sans:style:Bold"; tag: "hilight" "+ font=Sans:style:Bold";
// Need any tags? // Need any more tags?
} }
} }
parts { parts {
part { part {
name: "entry"; name: "entry";
description { description {
state: "default" 0.0; state: "default" 0.0;
image { image {
normal: "entry.png"; normal: "entry.png";
border: 6 6 8 7; border: 6 6 8 7;
} }
} }
description { description {
state: "disabled" 0.0; state: "disabled" 0.0;
inherit: "default" 0.0; inherit: "default" 0.0;
color: 255 255 255 128; color: 255 255 255 128;
} }
} }
part { part {
name: "entry_focus"; name: "entry_focus";
description { description {
state: "default" 0.0; state: "default" 0.0;
color: 255 255 255 0; color: 255 255 255 0;
image { image {
normal: "entry_focus.png"; normal: "entry_focus.png";
border: 7 7 8 7; border: 7 7 8 7;
middle: 0; middle: 0;
} }
fill { fill {
smooth: 0; smooth: 0;
} }
} }
description { description {
state: "focused" 0.0; state: "focused" 0.0;
inherit: "default" 0.0; inherit: "default" 0.0;
color: 255 255 255 255; color: 255 255 255 255;
} }
} }
part { part {
name: "label"; name: "label";
type: TEXTBLOCK; type: TEXTBLOCK;
mouse_events: 1; mouse_events: 1;
entry_mode: EDITABLE; entry_mode: EDITABLE;
multiline: 0; multiline: 0;
source2: "entry/selection/default"; source2: "entry/selection/default";
source3: "entry/cursor/default"; source3: "entry/cursor/default";
description { description {
state: "default" 0.0; state: "default" 0.0;
text { text {
style: "entry_default"; style: "entry_default";
min: 1 1; min: 1 1;
} }
rel1 { rel1 {
to: "entry"; to: "entry";
offset: 5 3; offset: 5 3;
} }
rel2 { rel2 {
to: "entry"; to: "entry";
offset: -2 -2; offset: -2 -2;
} }
} }
} }
} }
programs { programs {
program { program {
name: "focus1"; name: "focus1";
action: FOCUS_SET; action: FOCUS_SET;
signal: "mouse,down,*"; signal: "load";
source: "*"; source: "";
target: "label"; target: "label";
} }
program { program {
name: "focus2"; name: "focus2";
action: STATE_SET "focused" 0.0; action: STATE_SET "focused" 0.0;
signal: "mouse,down,*"; signal: "mouse,down,*";
source: "*"; source: "*";
target: "entry_focus"; target: "entry_focus";
transition: DECELERATE 0.5; transition: DECELERATE 0.5;
} }
program { program {
name: "focus_out"; name: "focus_out";
signal: "ecdb,focus,out"; signal: "ecdb,focus,out";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
source: "ecdb"; source: "ecdb";
target: "entry_focus"; target: "entry_focus";
transition: DECELERATE 0.5; transition: DECELERATE 0.5;
} }
program { program {
name: "disable"; name: "disable";
signal: "ecdb,disable"; signal: "ecdb,disable";
action: STATE_SET "disabled" 0.0; action: STATE_SET "disabled" 0.0;
source: "ecdb"; source: "ecdb";
target: "entry"; target: "entry";
} }
program { program {
name: "enable"; name: "enable";
signal: "ecdb,enable"; signal: "ecdb,enable";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
source: "ecdb"; source: "ecdb";
target: "entry"; target: "entry";
} }
} }
} }
group { group {
name: "entry/cursor/default"; name: "entry/cursor/default";
parts { parts {
part { part {
name: "cursor"; name: "cursor";
type: RECT; type: RECT;
mouse_events: 0; mouse_events: 0;
description { description {
state: "default" 0.0; state: "default" 0.0;
color: 0 0 0 255; color: 0 0 0 255;
min: 1 1; min: 1 1;
rel1 { rel1 {
relative: 0.0 0.0; relative: 0.0 0.0;
offset: 1 3; offset: 1 3;
} }
rel2 { rel2 {
relative: 0.0 1.0; relative: 0.0 1.0;
offset: 0 -2; offset: 0 -2;
} }
} }
} }
} }
} }
group { group {
name: "entry/selection/default"; name: "entry/selection/default";
parts { parts {
part { part {
name: "selection"; name: "selection";
type: RECT; type: RECT;
mouse_events: 0; mouse_events: 0;
description { description {
state: "default" 0.0; state: "default" 0.0;
color: 138 171 225 128; color: 138 171 225 128;
} }
} }
} }
} }

View File

@ -246,7 +246,6 @@ group {
state: "default" 0.0; state: "default" 0.0;
align: 0.5 0.5; align: 0.5 0.5;
color: 255 255 255 0; color: 255 255 255 0;
max: 245 99999;
rel1 { rel1 {
to: "filelist_overlay"; to: "filelist_overlay";
@ -262,7 +261,6 @@ group {
text: ""; text: "";
font: "ecdb/default"; font: "ecdb/default";
size: 24; size: 24;
min: 1 1;
align: 0.5 0.5; align: 0.5 0.5;
} }
} }

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
/* Global Variables */ /* Global Variables */

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_H #ifndef ECDB_H
#define ECDB_H #define ECDB_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
int transcode_data_cb(void *data, int type, void *event); int transcode_data_cb(void *data, int type, void *event);

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_AUDIO_H #ifndef ECDB_AUDIO_H
#define ECDB_AUDIO_H #define ECDB_AUDIO_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
typedef struct Burn_Data Burn_Data; typedef struct Burn_Data Burn_Data;

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_BURN_H #ifndef ECDB_BURN_H
#define ECDB_BURN_H #define ECDB_BURN_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_COMMON_H #ifndef ECDB_COMMON_H
#define ECDB_COMMON_H #define ECDB_COMMON_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
void ecdb_drive_info_free_cb(void *data); void ecdb_drive_info_free_cb(void *data);

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_DRIVES_H #ifndef ECDB_DRIVES_H
#define ECDB_DRIVES_H #define ECDB_DRIVES_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
int ecdb_erase_project_init(Ecdb_Erase_Project *proj); int ecdb_erase_project_init(Ecdb_Erase_Project *proj);

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_ERASE_H #ifndef ECDB_ERASE_H
#define ECDB_ERASE_H #define ECDB_ERASE_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
static void free_file(Ewl_Filelist_File *file); static void free_file(Ewl_Filelist_File *file);

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_FILELIST_CUSTOM_H #ifndef ECDB_FILELIST_CUSTOM_H
#define ECDB_FILELIST_CUSTOM_H #define ECDB_FILELIST_CUSTOM_H

View File

@ -1,6 +1,4 @@
/* /* vim: set sw=3 ts=3 sts=3 expandtab: */
* vim:ts=3:sw=3:sts=3:expandtab
*/
#include "ecdb.h" #include "ecdb.h"
static void ecdb_handle_typebuf(Evas_Object *gui); static void ecdb_handle_typebuf(Evas_Object *gui);
@ -472,17 +470,34 @@ ecdb_cb_burn_image_page_buttons_clicked(void *data, Evas_Object *o,
char buf[1024]; char buf[1024];
Ecdb_Burn_Result burn_result; Ecdb_Burn_Result burn_result;
proj = ecdb_burn_project_new();
ecdb_project_type_set(ECDB_PROJECT(proj), ECDB_IMAGE_PROJECT);
entry = evas_object_name_find(ecore_evas_get(em->main_win_ee), entry = evas_object_name_find(ecore_evas_get(em->main_win_ee),
"ecdb/burn_image/file"); "ecdb/burn_image/file");
file = edje_object_part_text_get(entry, "label"); file = edje_object_part_text_get(entry, "label");
//Textblock returns a <br> at the end, so chop that off //Textblock returns a <br> at the end, so chop that off
sanitized_file = alloca(sizeof(char) * (strlen(file) - 3)); if (!strcmp(&file[strlen(file) - 4], "<br>"))
sanitized_file[0] = '\0'; {
ecore_strlcpy(sanitized_file, file, strlen(file) - 3); sanitized_file = alloca(sizeof(char) * (strlen(file) - 3));
sanitized_file[0] = '\0';
ecore_strlcpy(sanitized_file, file, strlen(file) - 3);
printf("Sanitized_file: %s\n", sanitized_file);
}
else
{
// We aren't altering sanitized_file after this
sanitized_file = (char *)file;
}
// Make sure that file actually exists
if (!ecore_file_exists(sanitized_file))
{
edje_object_part_text_set(swallow, "progress_text", "File doesn't "
"exists!");
return;
}
proj = ecdb_burn_project_new();
ecdb_project_type_set(ECDB_PROJECT(proj), ECDB_IMAGE_PROJECT);
iso_file = ecdb_source_new(); iso_file = ecdb_source_new();
ecdb_source_data_set(iso_file, sanitized_file); ecdb_source_data_set(iso_file, sanitized_file);
ecdb_source_child_append(proj->files, iso_file); ecdb_source_child_append(proj->files, iso_file);

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_GUI_H #ifndef ECDB_GUI_H
#define ECDB_GUI_H #define ECDB_GUI_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
int ecdb_source_init(Ecdb_Source *src); int ecdb_source_init(Ecdb_Source *src);

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_IMAGE_H #ifndef ECDB_IMAGE_H
#define ECDB_IMAGE_H #define ECDB_IMAGE_H

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#include "ecdb.h" #include "ecdb.h"
Ecdb_Project * Ecdb_Project *

View File

@ -1,3 +1,4 @@
/* vim: set sw=3 ts=3 sts=3 expandtab: */
#ifndef ECDB_MISC_H #ifndef ECDB_MISC_H
#define ECDB_MISC_H #define ECDB_MISC_H