renaming max item defines
authorHyoyoung Chang <hyoyoung.chang@samsung.com>
Sat, 23 Oct 2010 06:00:55 +0000 (15:00 +0900)
committerHyoyoung Chang <hyoyoung.chang@samsung.com>
Sat, 23 Oct 2010 06:00:55 +0000 (15:00 +0900)
src/clipdrawer.c
src/common.h
src/storage.c
src/xcnphandler.c

index 315ebb5..c253e4c 100644 (file)
@@ -57,11 +57,11 @@ int clipdrawer_update_contents(void *data)
        int i, pos;
 
        elm_list_clear(ad->txtlist);
-       for (i = 0; i < HISTORY_QUEUE_NUMBER; i++)
+       for (i = 0; i < HISTORY_QUEUE_MAX_TXT_ITEMS; i++)
        {
                pos = get_current_history_position()+i;
-               if (pos > HISTORY_QUEUE_NUMBER-1)
-                       pos = pos-HISTORY_QUEUE_NUMBER;
+               if (pos > HISTORY_QUEUE_MAX_TXT_ITEMS-1)
+                       pos = pos-HISTORY_QUEUE_MAX_TXT_ITEMS;
                if (get_item_contents_by_pos(pos) != NULL && strlen(get_item_contents_by_pos(pos)) > 0)
                {
                        elm_list_item_append(ad->txtlist, get_item_contents_by_pos(pos), NULL, NULL, NULL, ad);
@@ -141,7 +141,7 @@ int clipdrawer_add_image_item(char *imagepath)
 
        igl = elm_gengrid_items_get(ad->imggrid);
        igl_counter = eina_list_count(igl);
-       if (igl_counter >= 10)
+       if (igl_counter >= HISTORY_QUEUE_MAX_IMG_ITEMS)
        {
                elm_gengrid_item_del(eina_list_nth(igl, 0));
        }
index 8b5c002..719a674 100644 (file)
@@ -31,6 +31,7 @@
 
 struct appdata;
 
-#define HISTORY_QUEUE_NUMBER 5
+#define HISTORY_QUEUE_MAX_TXT_ITEMS 5
+#define HISTORY_QUEUE_MAX_IMG_ITEMS 10
 
 #endif // _common_h_
index deb93df..55de30d 100644 (file)
@@ -2,7 +2,7 @@
 #include "storage.h"
 
 #define STORAGE_FILEPATH "/opt/var/.savecbh"
-#define STORAGE_MAX_ITEMS HISTORY_QUEUE_NUMBER
+#define STORAGE_MAX_ITEMS HISTORY_QUEUE_MAX_TXT_ITEMS
 #define HEADER_ITEM_SIZE (sizeof(int)) 
 #define BODY_ITEM_SIZE (4 * 1024) // 4Kilo 
 #define STORAGE_HEADER_SIZE (STORAGE_MAX_ITEMS * HEADER_ITEM_SIZE)
index d84af04..b85e0c9 100755 (executable)
@@ -93,7 +93,7 @@ static void _set_cbhmwin_prop()
 int increment_current_history_position()
 {
        int pos = g_history_pos+1;
-       if (pos >= HISTORY_QUEUE_NUMBER)
+       if (pos >= HISTORY_QUEUE_MAX_TXT_ITEMS)
                pos = 0;
        g_history_pos = pos;
        return pos;
@@ -103,7 +103,7 @@ int get_current_history_position()
 {
        int pos = g_history_pos-1;
        if (pos < 0)
-               pos = HISTORY_QUEUE_NUMBER;
+               pos = HISTORY_QUEUE_MAX_TXT_ITEMS;
        
        return pos;
 }
@@ -117,7 +117,7 @@ int add_to_storage_buffer(void *data, char *src, int len)
 
        if (g_lastest_content == NULL)
                g_lastest_content = malloc(sizeof(char)*(4*1024));
-       if (g_history_pos >= HISTORY_QUEUE_NUMBER)
+       if (g_history_pos >= HISTORY_QUEUE_MAX_TXT_ITEMS)
                g_history_pos = 0;
 
        // FIXME: remove g_lasteset_content
@@ -142,11 +142,11 @@ int print_storage_buffer()
 {
        int pos;
        int i = 0;
-       for (i = 0; i < HISTORY_QUEUE_NUMBER; i++)
+       for (i = 0; i < HISTORY_QUEUE_MAX_TXT_ITEMS; i++)
        {
                pos = get_current_history_position()+i;
-               if (pos > HISTORY_QUEUE_NUMBER-1)
-                       pos = pos-HISTORY_QUEUE_NUMBER;
+               if (pos > HISTORY_QUEUE_MAX_TXT_ITEMS-1)
+                       pos = pos-HISTORY_QUEUE_MAX_TXT_ITEMS;
                DTRACE("%d: %s\n", i, get_item_contents_by_pos(pos) != NULL ? get_item_contents_by_pos(pos) : "NULL");
        }
 }
@@ -428,7 +428,7 @@ static int _xclient_msg_cb(void *data, int ev_type, void *event)
        Atom atomCBHM_MSG = XInternAtom(g_disp, "CBHM_MSG", False);
        Atom atomCBHM_cRAW = XInternAtom(g_disp, "CBHM_cRAW", False);
        char atomname[10];
-       Atom cbhm_atoms[HISTORY_QUEUE_NUMBER];
+       Atom cbhm_atoms[HISTORY_QUEUE_MAX_TXT_ITEMS];
        Ecore_X_Window reqwin = ev->win;
        int i, pos;
 
@@ -459,10 +459,10 @@ static int _xclient_msg_cb(void *data, int ev_type, void *event)
                int num = ev->data.b[5] - '0';
                int cur = get_current_history_position();
                num = cur + num - 1;
-               if (num > HISTORY_QUEUE_NUMBER-1)
-                       num = num-HISTORY_QUEUE_NUMBER;
+               if (num > HISTORY_QUEUE_MAX_TXT_ITEMS-1)
+                       num = num-HISTORY_QUEUE_MAX_TXT_ITEMS;
 
-               if (num >= 0 && num < HISTORY_QUEUE_NUMBER)
+               if (num >= 0 && num < HISTORY_QUEUE_MAX_TXT_ITEMS)
                {
                        DTRACE("## pos : #%d\n", num);
                        // FIXME : handle with correct atom
@@ -495,7 +495,7 @@ static int _xclient_msg_cb(void *data, int ev_type, void *event)
                        }
                        pos--;
                        if (pos < 0)
-                               pos = HISTORY_QUEUE_NUMBER-1;
+                               pos = HISTORY_QUEUE_MAX_TXT_ITEMS-1;
                }
        }
        else if (strcmp("get raw", ev->data.b) == 0)