notepad Namespace Reference

Data Structures

class  Mutex
class  MutexLocker
class  CSemaphore
class  Command
class  CmdQueue
class  CNotepadDoc
class  CFileStore
struct  RenderPageCtx
class  CNotepadPages
class  CNPoint
class  CThumbnail
class  GCtx
struct  Point
 Point structure. More...
class  CNotepadWindow
class  renderCommand

Typedefs

typedef enum notepad::_PenSize PenSize

Enumerations

enum  _PenSize {
  PEN_FINE = 1, PEN_SMALL, PEN_MEDIUM, PEN_LARGE,
  PEN_XLARGE
}
enum  np_rotation { NP_PORTRAIT = 0, NP_CLOCKWISE, NP_ANTICLOCKWISE }
enum  np_result {
  NP_OK = 0, NP_IS_NOT_DIR, NP_FILE_EXISTS, NP_CREATE_FAILED,
  NP_OPEN_FAILED, NP_CLOSE_FAILED, NP_READ_FAILED, NP_RENAME_FAILED,
  NP_DELETE_FAILED, NP_NO_DOCUMENT, NP_NO_FILENAME, NP_SAVE_FAILED,
  NP_ALLOC_FAILED, NP_NO_PAGE, NP_ERROR
}

Functions

gboolean ipc_sys_is_pageturn_inverted (void)
 Query sysd if pageturning is inverted.
gboolean ipc_sys_is_in_portrait_mode (void)
 Query sysd if device in portrait mode.
gboolean ipc_set_services (void)
 Setup IPC connection and register API functions.
void ipc_unset_services (void)
 Unregister API functions.
gboolean ipc_sys_busy (gboolean busy)
 Send message sysSetBusy to system daemon.
gboolean ipc_sys_bg_busy (gboolean busy)
 Send message sysSetBgBusy to system daemon to set the busy LED indication.
np_rotation ipc_get_rotation (void)
const char * ipc_get_mountpoint ()
void ipc_sys_startup_complete (int xid)
 Report "settings started" to sysd.
void ipc_change_filename (const gchar *filename, const gchar *label)
void ipc_menu_set_pagecounter (int cur_page, int num_pages)
PenSize ipc_get_pensize (void)
void ipc_set_pensize (const PenSize new_pensize)
void menu_init (int pid, gpointer appwindow)
void menu_destroy ()
 Remove the popup menus.
void menu_block (gboolean block)
static void ipc_gconf_initialize (void)
static void ipc_gconf_read (void)
static void ipc_gconf_write (void)
static void ipc_gconf_finalize (void)
static void ipc_menu_update_toolbar (void)
static void menu_show (void)
static void menu_set_text (void)
static gboolean ipc_status_set_stylus (const char *state)
static void on_page_change (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_window_activated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_window_deactivated (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_menu_item (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_changed_locale (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_changed_pen (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_prepare_unmount (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_volume_unmounted (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_prepare_standby (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
static void on_changed_orientation (eripc_context_t *context, const eripc_event_info_t *info, void *user_data)
gboolean static_pageflip (gpointer data)
static gboolean check_filename_valid (const char *filename)

Variables

static const char * SCRIBBLE_LAST_READ_LOCATION = "scribble_last_read_location"
static eripc_client_context_teripcClient = 0
static int g_xid = 0
static notepad::CNotepadWindowgInstance = 0
static GConfClient * gClient = 0
static PenSize gPensize = GCONF_DEFAULT_PEN_SIZE
static gchar gMountpoint [88]
static const char * MENU = "notepad_menu"
static const char * ipc_menu = NULL
static const char * GROUP_PEN_TYPE = "notepad_pen_types"
static const char * ITEM_PEN = "pen"
static const char * ITEM_ERASER = "eraser"
static const char * GROUP_PEN = "notepad_pen"
static const char * GROUP_PEN2 = "notepad_pen2"
static const char * GROUP_PEN_SIZE = "notepad_pen_size"
static const char * ITEM_PEN_FINE = "pen_fine"
static const char * ITEM_PEN_SMALL = "pen_small"
static const char * ITEM_PEN_MEDIUM = "pen_medium"
static const char * ITEM_PEN_LARGE = "pen_large"
static const char * ITEM_PEN_XLARGE = "pen_xlarge"
static const char * GROUP_ACTIONS = "notepad_actions"
static const char * ITEM_ACTION_GOTOPAGE = "goto_page"
static const char * ITEM_ACTION_INSERTPAGE = "insert_page"
static const char * ITEM_ACTION_DELETEPAGE = "delete_page"
static const char * ITEM_ACTION_CLEARPAGE = "clear_page"
static const char * ITEM_ACTION_RENAME = "rename"
static const char * MENU_STATE_NORMAL = "normal"
static const char * MENU_STATE_SELECTED = "selected"
static const char * MENU_STATE_DISABLED = "disabled"
static const char * STYLUS_PEN = "pen"
static const char * STYLUS_ERASER = "eraser"
static eripc_callback_function_t service_functions []
static const char * THUMBNAIL_COLUMNS [CThumbnail::THUMBNAIL_COUNT]
static const char ILLEGAL_FILENAME_CHARS [] = "/\\:*?<>|"

Detailed Description

File Name : notepad_commandqueue.h

Description: command queue class for notepad prerender thread. and helper classes mutex, scopemutex, counting semaphore. Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_doc.h

Description: notepad document class Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_filestore.h

Description: open/close file and file generation abstraction Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_ipc.h

Description: menu handling Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_pages.h

Description: notepad pages cache class Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_point.h

Description: notepad point class Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_thumbnail.h

Description: save thumbnail of coverpage of note for contentbrowser Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_utils.h

Description: notepad utility classes Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

File Name : notepad_window.h

Description: notepad window class Copyright (C) 2010 IREX Technologies B.V. All rights reserved.

Copyright (C) 2010 IREX Technologies B.V. All rights reserved.


Typedef Documentation


Enumeration Type Documentation

Enumerator:
PEN_FINE 
PEN_SMALL 
PEN_MEDIUM 
PEN_LARGE 
PEN_XLARGE 

Definition at line 49 of file notepad_ipc.h.

00050     {
00051         PEN_FINE = 1,
00052         PEN_SMALL,
00053         PEN_MEDIUM,
00054         PEN_LARGE,
00055         PEN_XLARGE
00056     } PenSize;

Enumerator:
NP_OK 
NP_IS_NOT_DIR 
NP_FILE_EXISTS 
NP_CREATE_FAILED 
NP_OPEN_FAILED 
NP_CLOSE_FAILED 
NP_READ_FAILED 
NP_RENAME_FAILED 
NP_DELETE_FAILED 
NP_NO_DOCUMENT 
NP_NO_FILENAME 
NP_SAVE_FAILED 
NP_ALLOC_FAILED 
NP_NO_PAGE 
NP_ERROR 

Definition at line 46 of file notepad_utils.h.

00047     {
00048         NP_OK = 0,
00049         NP_IS_NOT_DIR,
00050         NP_FILE_EXISTS,
00051         NP_CREATE_FAILED,
00052         NP_OPEN_FAILED,
00053         NP_CLOSE_FAILED,
00054         NP_READ_FAILED,
00055         NP_RENAME_FAILED,
00056         NP_DELETE_FAILED,
00057         NP_NO_DOCUMENT,
00058         NP_NO_FILENAME,
00059         NP_SAVE_FAILED,
00060         NP_ALLOC_FAILED,
00061         NP_NO_PAGE,
00062         NP_ERROR
00063     } np_result;

Enumerator:
NP_PORTRAIT 
NP_CLOCKWISE 
NP_ANTICLOCKWISE 

Definition at line 39 of file notepad_utils.h.

00040     {
00041         NP_PORTRAIT = 0,
00042         NP_CLOCKWISE,
00043         NP_ANTICLOCKWISE
00044     } np_rotation;


Function Documentation

static gboolean notepad::check_filename_valid ( const char *  filename  )  [static]

Definition at line 971 of file notepad_window.cpp.

References ILLEGAL_FILENAME_CHARS, LOGPRINTF, and WARNPRINTF.

00972     {
00973         gboolean name_valid = TRUE;
00974         glong len = strlen(filename);
00975 
00976         if (len == 0)
00977         {
00978             // empty filename
00979             WARNPRINTF("rename to empty filename");
00980             name_valid = FALSE;
00981         }
00982         else if (len > 200)
00983         {
00984             // long filename
00985             WARNPRINTF("filename to long");
00986             name_valid = FALSE;
00987         }
00988         else if (filename[0] == '.')
00989         {
00990             // no . allowed on first character
00991             WARNPRINTF("hiddenfile not allowed");
00992             name_valid = FALSE;
00993         } 
00994         else if (g_unichar_isspace(filename[0]))
00995         {
00996             // no space allowed on first character
00997             WARNPRINTF("no spaces allowed on first character");
00998             name_valid = FALSE;
00999         }
01000         else
01001         {
01002             // check on illegal filename characters
01003             // note: filename can be utf8, but the illegal chars are ascii
01004             int n_illegal = strlen(ILLEGAL_FILENAME_CHARS);
01005             for (int i = 0; ((name_valid) && (i < n_illegal)); i++)
01006             {
01007                 if ( NULL != strchr(filename, ILLEGAL_FILENAME_CHARS[i]) )
01008                 {
01009                     LOGPRINTF("illegal character %c found", ILLEGAL_FILENAME_CHARS[i]);
01010                     name_valid = FALSE;
01011                 }
01012             }
01013         }
01014         return name_valid;
01015     }

void notepad::ipc_change_filename ( const gchar *  filename,
const gchar *  label 
)

Definition at line 319 of file notepad_ipc.cpp.

References eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, eripc_send_varargs(), ERIPC_TYPE_INT, ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, eripcClient, and g_xid.

Referenced by notepad::CNotepadDoc::rename(), and sys_startup_complete().

00320     {
00321         g_assert(g_xid);
00322         eripc_send_varargs(eripcClient->context, NULL, NULL, ERIPC_BUS_SESSION,
00323                 DBUS_SERVICE_SYSTEM_CONTROL, "renameTask",
00324                 ERIPC_TYPE_INT, g_xid,
00325                 ERIPC_TYPE_STRING, filename,
00326                 ERIPC_TYPE_STRING, label,
00327                 ERIPC_TYPE_INVALID);
00328     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void notepad::ipc_gconf_finalize ( void   )  [static]

Definition at line 502 of file notepad_ipc.cpp.

References gClient, and LOGPRINTF.

Referenced by ipc_unset_services().

00503     {
00504         LOGPRINTF("gconf_finalize");
00505         if (gClient != 0)
00506         {
00507             g_object_unref(G_OBJECT(gClient));
00508             gClient = 0;
00509         }
00510     }

Here is the caller graph for this function:

static void notepad::ipc_gconf_initialize ( void   )  [static]

Definition at line 493 of file notepad_ipc.cpp.

References gClient, and LOGPRINTF.

Referenced by ipc_sys_startup_complete().

00494     {
00495         LOGPRINTF("gconf_initialize");
00496         if (gClient == 0)
00497         {
00498             gClient = gconf_client_get_default();
00499         }
00500     }

Here is the caller graph for this function:

static void notepad::ipc_gconf_read ( void   )  [static]

Definition at line 512 of file notepad_ipc.cpp.

References gClient, GCONF_DEFAULT_PEN_SIZE, GCONF_PEN_SIZE, gPensize, LOGPRINTF, PEN_FINE, PEN_XLARGE, and WARNPRINTF.

Referenced by ipc_sys_startup_complete(), and on_window_activated().

00513     {
00514         LOGPRINTF("gconf_read");
00515         if (gClient)
00516         {
00517             gPensize = (PenSize) gconf_client_get_int(gClient, GCONF_PEN_SIZE, NULL);
00518             LOGPRINTF("getPenSize %d", gPensize);
00519             if ((gPensize < PEN_FINE) || (gPensize > PEN_XLARGE) )
00520             {
00521                 WARNPRINTF("invalid pensize setting, using default");
00522                 gPensize = GCONF_DEFAULT_PEN_SIZE;
00523             }
00524         }
00525     }

Here is the caller graph for this function:

static void notepad::ipc_gconf_write ( void   )  [static]

Definition at line 527 of file notepad_ipc.cpp.

References gClient, GCONF_PEN_SIZE, gPensize, and LOGPRINTF.

Referenced by ipc_set_pensize(), and on_window_deactivated().

00528     {
00529         LOGPRINTF("gconf_write pensize %d", gPensize);
00530         if (gClient)
00531         {
00532             (void) gconf_client_set_int(gClient, GCONF_PEN_SIZE, (gint) gPensize, NULL);
00533         }
00534     }

Here is the caller graph for this function:

const char * notepad::ipc_get_mountpoint (  ) 

Definition at line 272 of file notepad_ipc.cpp.

References eripc_event_info_t::args, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_event_info_free(), eripc_send_varargs_and_wait(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, eripcClient, ERRORPRINTF, gMountpoint, LOGPRINTF, eripc_arg_t::s, eripc_arg_t::type, and eripc_arg_t::value.

Referenced by notepad::CFileStore::createFile().

00273     {
00274         if (0 == g_strcmp0(gMountpoint, ""))
00275         {
00276             g_assert(eripcClient);
00277             eripc_event_info_t* reply = NULL;
00278             eripc_error_t result = eripc_send_varargs_and_wait( eripcClient->context,
00279                     &reply,                // reply handler
00280                     ERIPC_BUS_SESSION,
00281                     DBUS_SERVICE_SYSTEM_CONTROL,
00282                     "sysGetCardMountPoint",
00283                     ERIPC_TYPE_INVALID);
00284             if (result != ERIPC_ERROR_SUCCESS)
00285             {
00286                 ERRORPRINTF("%s: eripc_send_varargs returns [%d]", __func__, result);
00287                 return NULL;
00288             }
00289             g_assert(reply);
00290             g_assert(reply->args);
00291             g_assert(reply->args[0].type == ERIPC_TYPE_STRING);
00292             const char* valuestr = reply->args[0].value.s;
00293             if (valuestr[0] != 0) 
00294                 strncpy(gMountpoint, valuestr, 88-1);
00295             LOGPRINTF("mountpoint %s", gMountpoint);
00296             eripc_event_info_free(eripcClient->context, reply);
00297         }
00298         return gMountpoint;
00299     }

Here is the call graph for this function:

Here is the caller graph for this function:

PenSize notepad::ipc_get_pensize ( void   ) 

Definition at line 331 of file notepad_ipc.cpp.

References GCONF_DEFAULT_PEN_SIZE, gPensize, LOGPRINTF, PEN_FINE, PEN_XLARGE, and WARNPRINTF.

Referenced by menu_show(), and notepad::CNotepadDoc::on_scribble_begin().

00332     {
00333         PenSize size = gPensize;
00334         LOGPRINTF("get_pensize %d", size);
00335         if ((size < PEN_FINE) || (size > PEN_XLARGE) ) 
00336         {
00337             WARNPRINTF("invalid pensize setting, using default");
00338             size = GCONF_DEFAULT_PEN_SIZE;
00339         }
00340         return size;
00341     }

Here is the caller graph for this function:

np_rotation notepad::ipc_get_rotation ( void   ) 

Definition at line 362 of file notepad_ipc.cpp.

References eripc_event_info_t::args, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_send_varargs_and_wait(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, eripcClient, LOGPRINTF, NP_ANTICLOCKWISE, NP_CLOCKWISE, NP_PORTRAIT, rotation, eripc_arg_t::s, and eripc_arg_t::value.

00363     {
00364         LOGPRINTF("entry");
00365 
00366         eripc_error_t retval;
00367         eripc_event_info_t *info = NULL;
00368         np_rotation rotation = NP_PORTRAIT;
00369 
00370         retval = eripc_send_varargs_and_wait(eripcClient->context,
00371                 &info,
00372                 ERIPC_BUS_SESSION,
00373                 DBUS_SERVICE_SYSTEM_CONTROL,
00374                 "sysGetOrientation",
00375                 ERIPC_TYPE_INVALID);
00376 
00377         if (retval == ERIPC_ERROR_SUCCESS)
00378         {
00379             const eripc_arg_t *arg_array = info->args;
00380             if (arg_array[0].type == ERIPC_TYPE_STRING)
00381             {
00382                 const char* orientation = arg_array[0].value.s;
00383                 if (orientation)
00384                 {
00385                     if ( 0 == strcasecmp( orientation, "landscape_anticlockwise") )
00386                     {
00387                         rotation = NP_ANTICLOCKWISE;
00388                     }
00389                     else if ( 0 == strcasecmp( orientation, "landscape_clockwise") )
00390                     {
00391                         rotation = NP_CLOCKWISE;
00392                     }
00393                     else
00394                     {
00395                         rotation = NP_PORTRAIT;
00396                     }
00397                 }
00398             }
00399         }
00400 
00401         LOGPRINTF("exit %d", rotation);
00402         return rotation;
00403     }

Here is the call graph for this function:

void notepad::ipc_menu_set_pagecounter ( int  cur_page,
int  num_pages 
)

Definition at line 412 of file notepad_ipc.cpp.

References eripc_menu_set_item_state(), eripc_menu_set_pagecounter(), eripcClient, GROUP_ACTIONS, ipc_menu_update_toolbar(), ITEM_ACTION_GOTOPAGE, MENU_STATE_DISABLED, and MENU_STATE_NORMAL.

Referenced by notepad::CNotepadWindow::update_page_counter().

00413     {
00414         gboolean boundary_check = (num_pages != cur_page); // allow next to create new page
00415         eripc_menu_set_pagecounter(eripcClient, cur_page, num_pages, boundary_check);
00416         ipc_menu_update_toolbar();  
00417 
00418         if (num_pages == 1)
00419         {
00420             eripc_menu_set_item_state(eripcClient, ITEM_ACTION_GOTOPAGE, GROUP_ACTIONS, MENU_STATE_DISABLED );
00421         }
00422         else 
00423         {
00424             eripc_menu_set_item_state(eripcClient, ITEM_ACTION_GOTOPAGE, GROUP_ACTIONS, MENU_STATE_NORMAL );
00425         }
00426     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void notepad::ipc_menu_update_toolbar ( void   )  [static]

Definition at line 406 of file notepad_ipc.cpp.

References eripc_client_context_t::context, DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, eripc_send_varargs(), ERIPC_TYPE_INVALID, and eripcClient.

Referenced by ipc_menu_set_pagecounter(), menu_show(), on_menu_item(), and on_window_activated().

00407     {
00408         eripc_send_varargs(eripcClient->context, NULL, NULL, ERIPC_BUS_SESSION,
00409                 DBUS_SERVICE_POPUP_MENU, "updatesFinished", ERIPC_TYPE_INVALID);
00410     }

Here is the call graph for this function:

Here is the caller graph for this function:

void notepad::ipc_set_pensize ( const PenSize  new_pensize  ) 

Definition at line 344 of file notepad_ipc.cpp.

References gPensize, ipc_gconf_write(), LOGPRINTF, PEN_FINE, PEN_XLARGE, and WARNPRINTF.

Referenced by on_menu_item().

00345     {
00346         if ((gPensize < PEN_FINE) || (gPensize > PEN_XLARGE) )
00347         {
00348             WARNPRINTF("invalid new pen size, using default");
00349         }
00350         else
00351         {
00352             gPensize = new_pen_size;
00353             ipc_gconf_write(); 
00354             // write here: 
00355             // because we can have multiple instances, and on window switch the 
00356             // on_window_activate of the selected comes before the on_window_deactivate 
00357             // of the current 
00358         }
00359         LOGPRINTF("set pensize %d", gPensize);
00360     }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean notepad::ipc_set_services (  ) 

Setup IPC connection and register API functions.

File Name : index_ipc.h

Description: The dbus-based eripc functions Copyright (C) 2009 IREX Technologies B.V. All rights reserved.---------------------------------------------------------------------------

Name : ipc_set_services

Parameters:
None 
Returns:
--

--------------------------------------------------------------------------

Definition at line 213 of file notepad_ipc.cpp.

References DBUS_APPL_NAME, DBUS_INTERFACE, DBUS_PATH, DBUS_SERVICE, eripc_client_context_new(), eripcClient, interface, name, path, service, and service_functions.

00214     {
00215 
00216         pid_t pid = getpid();
00217         char name[128];
00218         sprintf(name, "%s_%05d", DBUS_APPL_NAME, pid);
00219         char service[128];
00220         sprintf(service, "%s_%05d", DBUS_SERVICE, pid);
00221         char path[128];
00222         sprintf(path, "%s_%05d", DBUS_PATH, pid);
00223         char interface[128];
00224         sprintf(interface, "%s_%05d", DBUS_INTERFACE, pid);
00225 
00226         eripcClient = eripc_client_context_new(
00227                 name,
00228                 "1.0",
00229                 service,
00230                 path,
00231                 interface,
00232                 service_functions);
00233         return (eripcClient != NULL);
00234     }

Here is the call graph for this function:

static gboolean notepad::ipc_status_set_stylus ( const char *  state  )  [static]

Definition at line 539 of file notepad_ipc.cpp.

References eripc_menu_set_statusitem_state(), and eripcClient.

Referenced by menu_show().

00540     {
00541         g_return_val_if_fail( (state != NULL), FALSE);
00542         return eripc_menu_set_statusitem_state(eripcClient, "statusbar_stylus", state);
00543     }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean notepad::ipc_sys_bg_busy ( gboolean  on  ) 

Send message sysSetBgBusy to system daemon to set the busy LED indication.

---------------------------------------------------------------------------

Name : ipc_sys_set_bg_busy

Parameters:
[in] on - TRUE to set busy state, FALSE to stop busy
Returns:
TRUE on success, FALSE otherwise

--------------------------------------------------------------------------

Definition at line 258 of file notepad_ipc.cpp.

References eripc_sysd_reset_bg_busy(), eripc_sysd_set_bg_busy(), eripcClient, and LOGPRINTF.

Referenced by download_error_cb(), download_requested_cb(), download_status_changed_cb(), and notepad::CNotepadDoc::draw_scribble_page().

00259     {
00260         LOGPRINTF("entry %d", busy);
00261 
00262         if (busy)
00263         {
00264             return eripc_sysd_set_bg_busy(eripcClient);
00265         }
00266         else
00267         {
00268             return eripc_sysd_reset_bg_busy(eripcClient);
00269         }
00270     }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean notepad::ipc_sys_busy ( gboolean  look_busy  ) 

Send message sysSetBusy to system daemon.

---------------------------------------------------------------------------

Name : ipc_sys_busy

Parameters:
[in] look_busy - TRUE to show, FALSE to remove the busy indication
Returns:
TRUE on success, FALSE otherwise

--------------------------------------------------------------------------

Definition at line 244 of file notepad_ipc.cpp.

References eripc_sysd_reset_busy(), eripc_sysd_set_busy(), eripcClient, and LOGPRINTF.

Referenced by notepad::CNotepadPages::get_page().

00245     {
00246         LOGPRINTF("entry %d", busy);
00247 
00248         if (busy)
00249         {
00250             return eripc_sysd_set_busy(eripcClient, "delaydialog", NULL);
00251         }
00252         else
00253         {
00254             return eripc_sysd_reset_busy(eripcClient);
00255         }
00256     }

Here is the call graph for this function:

Here is the caller graph for this function:

gboolean notepad::ipc_sys_is_in_portrait_mode (  ) 

Query sysd if device in portrait mode.

---------------------------------------------------------------------------

Name : ipc_sys_is_in_portrait_mode

Returns:
TRUE if in portrait mode, FALSE otherwise (landscape)

--------------------------------------------------------------------------

Definition at line 1040 of file notepad_ipc.cpp.

References eripc_event_info_t::args, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_event_info_free(), eripc_send_varargs_and_wait(), ERIPC_TYPE_INVALID, ERIPC_TYPE_STRING, eripcClient, ERRORPRINTF, LOGPRINTF, and eripc_arg_t::s.

01041     {
01042 
01043         gboolean result = TRUE;
01044 
01045         eripc_error_t retval;
01046         eripc_event_info_t* info = NULL;
01047 
01048         LOGPRINTF("entry");
01049 
01050         retval = eripc_send_varargs_and_wait(eripcClient->context,
01051                 &info,
01052                 ERIPC_BUS_SESSION,
01053                 DBUS_SERVICE_SYSTEM_CONTROL,
01054                 "sysGetOrientation",
01055                 ERIPC_TYPE_INVALID);
01056 
01057         if (retval != ERIPC_ERROR_SUCCESS)
01058         {
01059             ERRORPRINTF("Error launching eripc handler");
01060         }
01061         else if (info == NULL || info->args == NULL)
01062         {
01063             ERRORPRINTF("sysd returns OK but no reply structure");
01064         }
01065         else
01066         {
01067             const eripc_arg_t *arg_array = info->args;
01068 
01069             if (arg_array[0].type == ERIPC_TYPE_STRING)
01070             {
01071                 if ( strcmp("portrait", arg_array[0].value.s) == 0 )
01072                 {
01073                     result = TRUE;
01074                 }
01075                 else
01076                 {
01077                     result = FALSE;
01078                 }
01079             }
01080             else
01081             {
01082                 result = FALSE ;
01083             }
01084         }
01085         eripc_event_info_free(eripcClient->context, info);
01086         return result;
01087     }

Here is the call graph for this function:

gboolean notepad::ipc_sys_is_pageturn_inverted (  ) 

Query sysd if pageturning is inverted.

---------------------------------------------------------------------------

Name : ipc_sys_is_pageturn_inverted

Returns:
TRUE if inverted, FALSE otherwise

--------------------------------------------------------------------------

Definition at line 992 of file notepad_ipc.cpp.

References eripc_event_info_t::args, eripc_arg_t::b, eripc_client_context_t::context, DBUS_SERVICE_SYSTEM_CONTROL, ERIPC_BUS_SESSION, ERIPC_ERROR_SUCCESS, eripc_event_info_free(), eripc_send_varargs_and_wait(), ERIPC_TYPE_BOOL, ERIPC_TYPE_INVALID, eripcClient, ERRORPRINTF, and LOGPRINTF.

Referenced by display_flipbar_portrait(), main(), and on_changed_orientation().

00993     {
00994         gboolean result = FALSE;
00995 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW
00996         eripc_error_t retval;
00997         eripc_event_info_t* info = NULL;
00998 
00999         LOGPRINTF("entry");
01000 
01001         retval = eripc_send_varargs_and_wait(eripcClient->context,
01002                 &info,
01003                 ERIPC_BUS_SESSION,
01004                 DBUS_SERVICE_SYSTEM_CONTROL,
01005                 "sysGetPageturnInverted",
01006                 ERIPC_TYPE_INVALID);
01007 
01008         if (retval != ERIPC_ERROR_SUCCESS)
01009         {
01010             ERRORPRINTF("Error launching eripc handler");
01011         }
01012         else if (info == NULL || info->args == NULL)
01013         {
01014             ERRORPRINTF("sysd returns OK but no reply structure");
01015         }
01016         else
01017         {
01018             const eripc_arg_t *arg_array = info->args;
01019 
01020             if (arg_array[0].type == ERIPC_TYPE_BOOL)
01021             {
01022                 result = (gboolean) arg_array[0].value.b;
01023             }
01024             else
01025             {
01026                 result = FALSE ;
01027             }
01028         }
01029 
01030         eripc_event_info_free(eripcClient->context, info);
01031 #endif 
01032         return result;
01033     }

Here is the call graph for this function:

Here is the caller graph for this function:

void notepad::ipc_sys_startup_complete ( int  xid  ) 

Report "settings started" to sysd.

---------------------------------------------------------------------------

Name : ipc_sys_startup_complete

Parameters:
[in] xid Xwindows id of main window
Returns:
--

--------------------------------------------------------------------------

Definition at line 302 of file notepad_ipc.cpp.

00303     {
00304         // before sending startup_complete contruct default values;
00305         gMountpoint[0] = 0;
00306         gPensize = GCONF_DEFAULT_PEN_SIZE;
00307 
00308         ipc_gconf_initialize(); // initalize gconf client
00309         ipc_gconf_read();
00310 
00311         // send startup_complete
00312         g_xid = xid;
00313         eripc_sysd_startup_complete( eripcClient, getpid(), FALSE, xid);
00314 
00315         // re-read initialized items
00316         menu_show();
00317     }

void notepad::ipc_unset_services ( void   ) 

Unregister API functions.

---------------------------------------------------------------------------

Name : ipc_unset_services

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 237 of file notepad_ipc.cpp.

References eripc_client_context_free(), eripcClient, ipc_gconf_finalize(), and service_functions.

00238     {
00239         ipc_gconf_finalize(); // destruct gconf client
00240         eripc_client_context_free(eripcClient, service_functions);
00241         //menu_destroy();
00242     }

Here is the call graph for this function:

void notepad::menu_block ( gboolean  block  ) 

Definition at line 646 of file notepad_ipc.cpp.

References eripc_sysd_set_menu_state(), and eripcClient.

Referenced by notepad::CNotepadWindow::goto_page(), notepad::CNotepadWindow::init(), and notepad::CNotepadWindow::rename().

00647     {
00648         if (block)
00649         {
00650             eripc_sysd_set_menu_state(eripcClient, "block");
00651         }
00652         else
00653         {
00654             eripc_sysd_set_menu_state(eripcClient, "unblock");
00655         }
00656     }

Here is the call graph for this function:

Here is the caller graph for this function:

void notepad::menu_destroy ( void   ) 

Remove the popup menus.

---------------------------------------------------------------------------

Name : menu_destroy

Parameters:
-- 
Returns:
--

--------------------------------------------------------------------------

Definition at line 481 of file notepad_ipc.cpp.

References eripc_menu_remove_menu(), eripcClient, ipc_menu, ipc_remove_menu(), LOGPRINTF, and MENU_MAIN.

Referenced by main(), and main_quit().

00482     {
00483         eripc_menu_remove_menu(eripcClient, ipc_menu);
00484     }

Here is the call graph for this function:

Here is the caller graph for this function:

void notepad::menu_init ( int  pid,
gpointer  appwindow 
)

Definition at line 428 of file notepad_ipc.cpp.

References eripc_menu_add_group(), eripc_menu_add_item(), eripc_menu_add_menu(), eripcClient, gInstance, GROUP_ACTIONS, GROUP_PEN, GROUP_PEN2, GROUP_PEN_SIZE, GROUP_PEN_TYPE, ipc_menu, ITEM_ACTION_CLEARPAGE, ITEM_ACTION_CLOSE, ITEM_ACTION_DELETEPAGE, ITEM_ACTION_GOTOPAGE, ITEM_ACTION_INSERTPAGE, ITEM_ACTION_RENAME, ITEM_ERASER, ITEM_PEN, ITEM_PEN_FINE, ITEM_PEN_LARGE, ITEM_PEN_MEDIUM, ITEM_PEN_SMALL, ITEM_PEN_XLARGE, LOGPRINTF, MENU, menu_set_text(), and menu_show().

00429     {
00430         LOGPRINTF("entry");
00431         g_assert( appwindow != 0 ); 
00432         if (appwindow == 0)
00433         {
00434             fprintf(stderr, "menu without window\n");
00435             return;
00436         }
00437         gInstance = static_cast <notepad::CNotepadWindow*> (appwindow);
00438 
00439         ipc_menu = g_strdup_printf("%s_%05d", MENU, pid);
00440         // MENU
00441         // |
00442         // |-- Pen type
00443         eripc_menu_add_group(eripcClient, GROUP_PEN_TYPE,       "",             "pen_type"          );
00444         eripc_menu_add_item(eripcClient, ITEM_PEN   ,           GROUP_PEN_TYPE, "pen"               ); 
00445         eripc_menu_add_item(eripcClient, ITEM_ERASER,           GROUP_PEN_TYPE, "eraser"            ); 
00446         // |
00447         // |-- PEN 
00448         eripc_menu_add_group(eripcClient, GROUP_PEN,            "",             "notepad_pen_menu"  ); 
00449         eripc_menu_add_group(eripcClient, GROUP_PEN2,           GROUP_PEN,      "tools_drawing"     ); 
00450         //     |
00451         //     |-- line sizes 
00452         eripc_menu_add_group(eripcClient, GROUP_PEN_SIZE,       GROUP_PEN2,     "notepad_pen_size"  ); 
00453         eripc_menu_add_item(eripcClient, ITEM_PEN_FINE,         GROUP_PEN_SIZE, "stylus_1"          ); 
00454         eripc_menu_add_item(eripcClient, ITEM_PEN_SMALL,        GROUP_PEN_SIZE, "stylus_2"          ); 
00455         eripc_menu_add_item(eripcClient, ITEM_PEN_MEDIUM,       GROUP_PEN_SIZE, "stylus_3"          ); 
00456         eripc_menu_add_item(eripcClient, ITEM_PEN_LARGE,        GROUP_PEN_SIZE, "stylus_4"          ); 
00457         eripc_menu_add_item(eripcClient, ITEM_PEN_XLARGE,       GROUP_PEN_SIZE, "stylus_5"          ); 
00458         // |
00459         // |-- actions
00460         eripc_menu_add_group(eripcClient, GROUP_ACTIONS,        "",             "notepad_actions"   );
00461         eripc_menu_add_item(eripcClient, ITEM_ACTION_GOTOPAGE,  GROUP_ACTIONS,  "goto_page"         );
00462         eripc_menu_add_item(eripcClient, ITEM_ACTION_INSERTPAGE,GROUP_ACTIONS,  "insert_page"       );
00463         eripc_menu_add_item(eripcClient, ITEM_ACTION_DELETEPAGE,GROUP_ACTIONS,  "delete_page"       );
00464         eripc_menu_add_item(eripcClient, ITEM_ACTION_CLEARPAGE, GROUP_ACTIONS,  "clear_page"        );
00465         eripc_menu_add_item(eripcClient, ITEM_ACTION_RENAME,    GROUP_ACTIONS,  "rename"            );
00466 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00467         eripc_menu_add_item(eripcClient, ITEM_ACTION_CLOSE,     GROUP_ACTIONS,  "close"             );
00468 #endif
00469 
00470         // add menus
00471         eripc_menu_add_menu(eripcClient, ipc_menu, GROUP_ACTIONS, GROUP_PEN, GROUP_PEN_TYPE, NULL);
00472 
00473         // localize text
00474         menu_set_text();
00475 
00476         menu_show();
00477         LOGPRINTF("exit");
00478     }

Here is the call graph for this function:

static void notepad::menu_set_text ( void   )  [static]

Definition at line 545 of file notepad_ipc.cpp.

References eripc_menu_set_group_label(), eripc_menu_set_item_label(), eripcClient, GROUP_ACTIONS, GROUP_PEN2, GROUP_PEN_SIZE, GROUP_PEN_TYPE, ITEM_ACTION_CLEARPAGE, ITEM_ACTION_CLOSE, ITEM_ACTION_DELETEPAGE, ITEM_ACTION_GOTOPAGE, ITEM_ACTION_INSERTPAGE, ITEM_ACTION_RENAME, ITEM_ERASER, ITEM_PEN, ITEM_PEN_FINE, ITEM_PEN_LARGE, ITEM_PEN_MEDIUM, ITEM_PEN_SMALL, and ITEM_PEN_XLARGE.

Referenced by menu_init(), and on_changed_locale().

00546     {
00547         // MENU
00548         // |
00549         // |-- Pen type
00550         eripc_menu_set_item_label(eripcClient, ITEM_PEN,                GROUP_PEN_TYPE, _("Pen"         ));
00551         eripc_menu_set_item_label(eripcClient, ITEM_ERASER,             GROUP_PEN_TYPE, _("Eraser"      ));
00552         // |
00553         // |-- PEN 
00554         eripc_menu_set_group_label(eripcClient, GROUP_PEN2, _("Pen Size")); 
00555         //     |
00556         //     |-- line sizes options
00557         eripc_menu_set_item_label(eripcClient, ITEM_PEN_FINE,           GROUP_PEN_SIZE, _("Fine"        ));
00558         eripc_menu_set_item_label(eripcClient, ITEM_PEN_SMALL,          GROUP_PEN_SIZE, _("Small"       ));
00559         eripc_menu_set_item_label(eripcClient, ITEM_PEN_MEDIUM,         GROUP_PEN_SIZE, _("Medium"      ));
00560         eripc_menu_set_item_label(eripcClient, ITEM_PEN_LARGE,          GROUP_PEN_SIZE, _("Large"       ));
00561         eripc_menu_set_item_label(eripcClient, ITEM_PEN_XLARGE,         GROUP_PEN_SIZE, _("X-Large"     ));
00562         // |
00563         // |-- actions
00564         eripc_menu_set_item_label(eripcClient, ITEM_ACTION_GOTOPAGE,    GROUP_ACTIONS,  _("Go to Page..."));
00565         eripc_menu_set_item_label(eripcClient, ITEM_ACTION_INSERTPAGE,  GROUP_ACTIONS,  _("Insert Page" ));
00566         eripc_menu_set_item_label(eripcClient, ITEM_ACTION_CLEARPAGE,   GROUP_ACTIONS,  _("Clear Page..."  ));
00567         eripc_menu_set_item_label(eripcClient, ITEM_ACTION_DELETEPAGE,  GROUP_ACTIONS,  _("Delete Page..."  ));
00568         eripc_menu_set_item_label(eripcClient, ITEM_ACTION_RENAME,      GROUP_ACTIONS,  _("Rename..."   ));
00569 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00570         eripc_menu_set_item_label(eripcClient, ITEM_ACTION_CLOSE,       GROUP_ACTIONS,  _("Close" ));
00571 #endif    
00572     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void notepad::menu_show ( void   )  [static]

Definition at line 575 of file notepad_ipc.cpp.

References eripc_client_context_t::context, DBUS_SERVICE_POPUP_MENU, ERIPC_BUS_SESSION, eripc_menu_set_item_state(), eripc_menu_show_menu(), eripc_send_varargs(), ERIPC_TYPE_INVALID, eripcClient, notepad::CNotepadWindow::get_scribble_mode(), gInstance, GROUP_PEN_SIZE, GROUP_PEN_TYPE, ipc_get_pensize(), ipc_menu, ipc_menu_update_toolbar(), ipc_status_set_stylus(), ITEM_ERASER, ITEM_PEN, ITEM_PEN_FINE, ITEM_PEN_LARGE, ITEM_PEN_MEDIUM, ITEM_PEN_SMALL, ITEM_PEN_XLARGE, LOGPRINTF, MENU_STATE_NORMAL, MENU_STATE_SELECTED, PEN_FINE, PEN_LARGE, PEN_MEDIUM, PEN_SMALL, PEN_XLARGE, STYLUS_ERASER, STYLUS_PEN, notepad::CNotepadWindow::update_page_counter(), and WARNPRINTF.

Referenced by ipc_sys_startup_complete(), menu_init(), on_changed_pen(), on_menu_item(), and on_window_activated().

00576     {
00577         LOGPRINTF("entry");
00578         // show selections
00579         gboolean scribblemode = gInstance->get_scribble_mode();
00580         if (scribblemode)
00581         {
00582             eripc_menu_set_item_state(eripcClient, ITEM_PEN, GROUP_PEN_TYPE, MENU_STATE_SELECTED );
00583             eripc_menu_set_item_state(eripcClient, ITEM_ERASER, GROUP_PEN_TYPE, MENU_STATE_NORMAL );
00584             ipc_status_set_stylus( STYLUS_PEN );
00585             eripc_send_varargs(eripcClient->context, NULL, NULL, ERIPC_BUS_SESSION,
00586                     DBUS_SERVICE_POPUP_MENU, "updatesFinished", ERIPC_TYPE_INVALID);
00587         }
00588         else
00589         {
00590             eripc_menu_set_item_state(eripcClient, ITEM_ERASER, GROUP_PEN_TYPE, MENU_STATE_SELECTED );
00591             eripc_menu_set_item_state(eripcClient, ITEM_PEN, GROUP_PEN_TYPE, MENU_STATE_NORMAL );
00592             ipc_status_set_stylus( STYLUS_ERASER );
00593             eripc_send_varargs(eripcClient->context, NULL, NULL, ERIPC_BUS_SESSION,
00594                     DBUS_SERVICE_POPUP_MENU, "updatesFinished", ERIPC_TYPE_INVALID);
00595         }
00596 
00597         PenSize ps = ipc_get_pensize();
00598         switch (ps)
00599         {
00600             case PEN_FINE:
00601                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_FINE,   GROUP_PEN_SIZE, MENU_STATE_SELECTED );
00602                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_SMALL,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00603                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_MEDIUM, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00604                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_LARGE,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00605                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_XLARGE, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00606                 break;
00607             case PEN_SMALL:
00608                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_FINE,   GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00609                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_SMALL,  GROUP_PEN_SIZE, MENU_STATE_SELECTED );
00610                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_MEDIUM, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00611                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_LARGE,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00612                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_XLARGE, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00613                 break;
00614             case PEN_MEDIUM:
00615                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_FINE,   GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00616                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_SMALL,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00617                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_MEDIUM, GROUP_PEN_SIZE, MENU_STATE_SELECTED );
00618                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_LARGE,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00619                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_XLARGE, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00620                 break;
00621             case PEN_LARGE:
00622                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_FINE,   GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00623                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_SMALL,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00624                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_MEDIUM, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00625                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_LARGE,  GROUP_PEN_SIZE, MENU_STATE_SELECTED );
00626                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_XLARGE, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00627                 break;
00628             case PEN_XLARGE:
00629                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_FINE,   GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00630                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_SMALL,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00631                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_MEDIUM, GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00632                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_LARGE,  GROUP_PEN_SIZE, MENU_STATE_NORMAL );
00633                 eripc_menu_set_item_state(eripcClient, ITEM_PEN_XLARGE, GROUP_PEN_SIZE, MENU_STATE_SELECTED );
00634                 break;
00635             default:
00636                 WARNPRINTF("unsupported pensize\n");
00637         }
00638 
00639         eripc_menu_show_menu(eripcClient, ipc_menu);
00640         gInstance->update_page_counter();
00641         ipc_menu_update_toolbar();  
00642 
00643         LOGPRINTF("exit");
00644     }

Here is the call graph for this function:

Here is the caller graph for this function:

static void notepad::on_changed_locale ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 847 of file notepad_ipc.cpp.

References menu_set_text().

00851     {
00852         menu_set_text();
00853     }

Here is the call graph for this function:

static void notepad::on_changed_orientation ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 923 of file notepad_ipc.cpp.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, gInstance, ipc_sys_is_pageturn_inverted(), LOGPRINTF, eripc_arg_t::s, notepad::CNotepadWindow::set_pageturn_inverted(), and eripc_arg_t::value.

00927     {
00928         LOGPRINTF("entry");
00929 
00930         const eripc_arg_t *arg_array = info->args;
00931         if (arg_array[0].type == ERIPC_TYPE_STRING)
00932         {
00933             const char* orientation = arg_array[0].value.s;
00934             if (orientation)
00935             {
00936                 if ( strcmp(orientation, "portrait") == 0)
00937                 {
00938 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW
00939                     gboolean is_inverted = ipc_sys_is_pageturn_inverted();
00940                     (void) gInstance->set_pageturn_inverted(is_inverted);
00941 #else
00942                     ;
00943 #endif 
00944                 }
00945                 else
00946                 {
00947                     // landscapee
00948 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW
00949                     (void) gInstance->set_pageturn_inverted(FALSE);
00950 #else           
00951                     ;
00952 #endif 
00953                 }
00954                 // Note: dont call set_rotation from here, window gets configure event.
00955                 // Note: timing of this on_changed_orientation depends on rotation direction.
00956             }
00957         }
00958         LOGPRINTF("exit");
00959     }

Here is the call graph for this function:

static void notepad::on_changed_pen ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 855 of file notepad_ipc.cpp.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, gInstance, LOGPRINTF, menu_show(), eripc_arg_t::s, notepad::CNotepadWindow::set_scribble_mode(), STYLUS_ERASER, STYLUS_PEN, eripc_arg_t::type, and eripc_arg_t::value.

00859     {
00860         g_return_if_fail(info->args);
00861         g_return_if_fail(info->args[0].type == ERIPC_TYPE_STRING);
00862 
00863         const eripc_arg_t *arg_array = info->args;
00864         const char        *item      = arg_array[0].value.s;
00865         const char        *value     = arg_array[1].value.s;
00866 
00867         LOGPRINTF("entry: on_changed_pen: item [%s] value [%s]", item, value);
00868         if ( strcmp(item, "statusbar_stylus") == 0 )
00869         {
00870             if ( strcmp(value, STYLUS_PEN) == 0 )
00871             {
00872                 LOGPRINTF("pen");
00873                 gInstance->set_scribble_mode(FALSE); //toggle
00874                 menu_show();
00875             }
00876             else if ( strcmp(value, STYLUS_ERASER  ) == 0 )
00877             {
00878                 LOGPRINTF("erase");
00879                 gInstance->set_scribble_mode(TRUE); //toggle
00880                 menu_show();
00881             }
00882         }
00883     }

Here is the call graph for this function:

static void notepad::on_menu_item ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 718 of file notepad_ipc.cpp.

References eripc_event_info_t::args, notepad::CNotepadWindow::clear_current_page(), notepad::CNotepadWindow::delete_current_page(), ERIPC_TYPE_STRING, gInstance, notepad::CNotepadWindow::goto_page(), GROUP_ACTIONS, GROUP_PEN_SIZE, GROUP_PEN_TYPE, notepad::CNotepadWindow::insert_page(), ipc_menu_update_toolbar(), ipc_set_pensize(), ITEM_ACTION_CLEARPAGE, ITEM_ACTION_CLOSE, ITEM_ACTION_DELETEPAGE, ITEM_ACTION_GOTOPAGE, ITEM_ACTION_INSERTPAGE, ITEM_ACTION_RENAME, ITEM_ERASER, ITEM_PEN, ITEM_PEN_FINE, ITEM_PEN_LARGE, ITEM_PEN_MEDIUM, ITEM_PEN_SMALL, ITEM_PEN_XLARGE, LOGPRINTF, menu_show(), MENU_STATE_NORMAL, PEN_FINE, PEN_LARGE, PEN_MEDIUM, PEN_SMALL, PEN_XLARGE, notepad::CNotepadWindow::quit(), notepad::CNotepadWindow::rename(), eripc_arg_t::s, notepad::CNotepadWindow::save(), notepad::CNotepadWindow::set_scribble_mode(), eripc_arg_t::type, and eripc_arg_t::value.

00722     {
00723         g_return_if_fail(info->args);
00724         g_return_if_fail(info->args[0].type == ERIPC_TYPE_STRING);
00725         g_return_if_fail(info->args[1].type == ERIPC_TYPE_STRING);
00726         g_return_if_fail(info->args[2].type == ERIPC_TYPE_STRING);
00727         g_return_if_fail(info->args[3].type == ERIPC_TYPE_STRING);
00728 
00729         g_return_if_fail(info->args[0].value.s != 0);
00730         g_return_if_fail(info->args[1].value.s != 0);
00731         g_return_if_fail(info->args[2].value.s != 0);
00732         g_return_if_fail(info->args[3].value.s != 0);
00733 
00734         const eripc_arg_t *arg_array = info->args;
00735         const char        *item      = arg_array[0].value.s;
00736         const char        *group     = arg_array[1].value.s;
00737         const char        *menu      = arg_array[2].value.s;
00738         const char        *state     = arg_array[3].value.s;
00739 
00740         LOGPRINTF("entry: on_menu_item: item [%s] group [%s] menu [%s] state [%s]", item, group, menu, state);
00741 
00742         if (item && group && menu && state)
00743         {
00744             if ( strcmp(group, GROUP_PEN_TYPE) == 0 )
00745             {
00746                 if ( strcmp(state, MENU_STATE_NORMAL) == 0 )
00747                 {
00748                     if ( strcmp(item, ITEM_PEN) == 0 )
00749                     {
00750                         LOGPRINTF("pen");
00751                         gInstance->set_scribble_mode(TRUE);
00752                     }
00753                     else if ( strcmp(item, ITEM_ERASER  ) == 0 )
00754                     {
00755                         LOGPRINTF("erase");
00756                         gInstance->set_scribble_mode(FALSE);
00757                     }
00758                 }
00759                 menu_show();
00760             }
00761             else if ( strcmp(group, GROUP_PEN_SIZE) == 0 )
00762             {
00763 
00764                 if ( strcmp(state, MENU_STATE_NORMAL) == 0 )
00765                 {
00766                     if ( strcmp(item, ITEM_PEN_FINE) == 0 )
00767                     {
00768                         LOGPRINTF("pen_fine");
00769                         ipc_set_pensize(PEN_FINE);
00770                     }
00771                     else if ( strcmp(item, ITEM_PEN_SMALL) == 0 )
00772                     {
00773                         LOGPRINTF("pen_small");
00774                         ipc_set_pensize(PEN_SMALL);
00775                     }
00776                     else if ( strcmp(item, ITEM_PEN_MEDIUM) == 0 )
00777                     {
00778                         LOGPRINTF("pen_medium");
00779                         ipc_set_pensize(PEN_MEDIUM);
00780                     }
00781                     else if ( strcmp(item, ITEM_PEN_LARGE) == 0 )
00782                     {
00783                         LOGPRINTF("pen_large");
00784                         ipc_set_pensize(PEN_LARGE);
00785                     }
00786                     else if ( strcmp(item, ITEM_PEN_XLARGE) == 0 )
00787                     {
00788                         LOGPRINTF("pen_xlarge");
00789                         ipc_set_pensize(PEN_XLARGE);
00790                     }
00791                 }
00792                 // Do not stay on eraser mode
00793                 gInstance->set_scribble_mode(TRUE);
00794                 menu_show();
00795             }
00796             else if ( strcmp(group, GROUP_ACTIONS) == 0 )
00797             {
00798                 if ( strcmp(state, MENU_STATE_NORMAL) == 0 )
00799                 {
00800                     if ( strcmp(item, ITEM_ACTION_RENAME ) == 0 )
00801                     {
00802                         LOGPRINTF("rename");
00803                         gInstance->rename();
00804                     }
00805 #if MACHINE_IS_DR1000S || MACHINE_IS_DR1000SW
00806                     else if ( strcmp(item, ITEM_ACTION_CLOSE ) == 0 )
00807                     {
00808                         LOGPRINTF("close");
00809                         (void) gInstance->save();
00810                         gInstance->quit();
00811                     }
00812 #endif                
00813                     else if ( strcmp(item, ITEM_ACTION_GOTOPAGE ) == 0 )
00814                     {
00815                         LOGPRINTF("gotopage");
00816                         gInstance->goto_page();
00817                     }
00818                     else if ( strcmp(item, ITEM_ACTION_INSERTPAGE ) == 0 )
00819                     {
00820                         LOGPRINTF("insertpage");
00821                         gInstance->insert_page();
00822                     }
00823                     else if ( strcmp(item, ITEM_ACTION_CLEARPAGE ) == 0 )
00824                     {
00825                         LOGPRINTF("clearpage");
00826                         gInstance->clear_current_page();
00827                     }
00828                     else if ( strcmp(item, ITEM_ACTION_DELETEPAGE ) == 0 )
00829                     {
00830                         LOGPRINTF("deletepage");
00831                         gInstance->delete_current_page();
00832                     }
00833                     else
00834                     {
00835                         fprintf(stderr, "ignore state [%s] item [%s][%s]", state, item, group);
00836                     }
00837                 }
00838                 else
00839                 {
00840                     fprintf(stderr, "unexpected menu group [%s]", group);
00841                 }
00842             }
00843             ipc_menu_update_toolbar();  
00844         }
00845     }

Here is the call graph for this function:

static void notepad::on_page_change ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 664 of file notepad_ipc.cpp.

References eripc_event_info_t::args, ERIPC_TYPE_STRING, gInstance, notepad::CNotepadWindow::pageflip_back(), notepad::CNotepadWindow::pageflip_forward(), eripc_arg_t::s, and eripc_arg_t::value.

00668     {
00669         const eripc_arg_t *arg_array = info->args;
00670         g_return_if_fail(arg_array[0].type == ERIPC_TYPE_STRING);
00671         gchar* direction = arg_array[0].value.s;
00672 
00673         if (strcmp(direction, "prev") == 0) 
00674         {   
00675             gInstance->pageflip_back();
00676         }
00677         if (strcmp(direction, "next") == 0) 
00678         {
00679             gInstance->pageflip_forward();
00680         }
00681     }

Here is the call graph for this function:

static void notepad::on_prepare_standby ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 906 of file notepad_ipc.cpp.

References gInstance, LOGPRINTF, and notepad::CNotepadWindow::save().

00910     {
00911         LOGPRINTF("entry");
00912         (void) gInstance->save();
00913         LOGPRINTF("exit");
00914     }

Here is the call graph for this function:

static void notepad::on_prepare_unmount ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 885 of file notepad_ipc.cpp.

References gInstance, LOGPRINTF, notepad::CNotepadWindow::quit(), and notepad::CNotepadWindow::save().

00889     {
00890         LOGPRINTF("entry");
00891         (void) gInstance->save(true);
00892         gInstance->quit();
00893         LOGPRINTF("exit");
00894     }

Here is the call graph for this function:

static void notepad::on_volume_unmounted ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 896 of file notepad_ipc.cpp.

References gInstance, LOGPRINTF, and notepad::CNotepadWindow::quit().

00900     {
00901         LOGPRINTF("entry");
00902         gInstance->quit();
00903         LOGPRINTF("exit");
00904     }

Here is the call graph for this function:

static void notepad::on_window_activated ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 684 of file notepad_ipc.cpp.

References gInstance, ipc_gconf_read(), ipc_menu_update_toolbar(), LOGPRINTF, menu_show(), notepad::CNotepadWindow::save(), and notepad::CNotepadWindow::update_page_counter().

00688     {
00689         LOGPRINTF("entry");
00690 
00691         (void) gInstance->save();
00692         ipc_gconf_read();
00693         menu_show();
00694         gInstance->update_page_counter();
00695         ipc_menu_update_toolbar();  
00696 
00697         LOGPRINTF("exit");
00698     }

Here is the call graph for this function:

static void notepad::on_window_deactivated ( eripc_context_t context,
const eripc_event_info_t info,
void *  user_data 
) [static]

Definition at line 701 of file notepad_ipc.cpp.

References gInstance, ipc_gconf_write(), LOGPRINTF, notepad::CNotepadWindow::quit(), and notepad::CNotepadWindow::save().

00705     {
00706         LOGPRINTF("entry");
00707 
00708         (void) gInstance->save();
00709         ipc_gconf_write();
00710 #if MACHINE_IS_DR800S || MACHINE_IS_DR800SG || MACHINE_IS_DR800SW
00711         gInstance->quit();
00712 #endif
00713 
00714         LOGPRINTF("exit");
00715     }

Here is the call graph for this function:

gboolean notepad::static_pageflip ( gpointer  data  ) 

Definition at line 741 of file notepad_window.cpp.

References notepad::CNotepadWindow::pageflip_or_create().

Referenced by notepad::CNotepadWindow::pageflip_back(), and notepad::CNotepadWindow::pageflip_forward().

00742     {
00743         CNotepadWindow* instance = (CNotepadWindow*) data;
00744         instance->pageflip_or_create(); // given pageno as class variable pageflipto
00745         return FALSE;
00746     }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

int notepad::g_xid = 0 [static]

Definition at line 58 of file notepad_ipc.cpp.

Referenced by ipc_change_filename(), and ipc_sys_startup_complete().

GConfClient* notepad::gClient = 0 [static]
gchar notepad::gMountpoint[88] [static]

Definition at line 66 of file notepad_ipc.cpp.

Referenced by ipc_get_mountpoint(), and ipc_sys_startup_complete().

PenSize notepad::gPensize = GCONF_DEFAULT_PEN_SIZE [static]
const char* notepad::GROUP_ACTIONS = "notepad_actions" [static]

Definition at line 95 of file notepad_ipc.cpp.

Referenced by ipc_menu_set_pagecounter(), menu_init(), menu_set_text(), and on_menu_item().

const char* notepad::GROUP_PEN = "notepad_pen" [static]

Definition at line 83 of file notepad_ipc.cpp.

Referenced by menu_init().

const char* notepad::GROUP_PEN2 = "notepad_pen2" [static]

Definition at line 85 of file notepad_ipc.cpp.

Referenced by menu_init(), and menu_set_text().

const char* notepad::GROUP_PEN_SIZE = "notepad_pen_size" [static]

Definition at line 87 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::GROUP_PEN_TYPE = "notepad_pen_types" [static]

Definition at line 79 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char notepad::ILLEGAL_FILENAME_CHARS[] = "/\\:*?<>|" [static]

Definition at line 46 of file notepad_window.cpp.

Referenced by check_filename_valid().

const char* notepad::ipc_menu = NULL [static]

Definition at line 75 of file notepad_ipc.cpp.

Referenced by menu_destroy(), menu_init(), and menu_show().

const char* notepad::ITEM_ACTION_CLEARPAGE = "clear_page" [static]

Definition at line 99 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), and on_menu_item().

const char* notepad::ITEM_ACTION_DELETEPAGE = "delete_page" [static]

Definition at line 98 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), and on_menu_item().

const char* notepad::ITEM_ACTION_GOTOPAGE = "goto_page" [static]

Definition at line 96 of file notepad_ipc.cpp.

Referenced by ipc_menu_set_pagecounter(), menu_init(), menu_set_text(), and on_menu_item().

const char* notepad::ITEM_ACTION_INSERTPAGE = "insert_page" [static]

Definition at line 97 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), and on_menu_item().

const char* notepad::ITEM_ACTION_RENAME = "rename" [static]

Definition at line 100 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), and on_menu_item().

const char* notepad::ITEM_ERASER = "eraser" [static]

Definition at line 81 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::ITEM_PEN = "pen" [static]

Definition at line 80 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::ITEM_PEN_FINE = "pen_fine" [static]

Definition at line 88 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::ITEM_PEN_LARGE = "pen_large" [static]

Definition at line 91 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::ITEM_PEN_MEDIUM = "pen_medium" [static]

Definition at line 90 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::ITEM_PEN_SMALL = "pen_small" [static]

Definition at line 89 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::ITEM_PEN_XLARGE = "pen_xlarge" [static]

Definition at line 92 of file notepad_ipc.cpp.

Referenced by menu_init(), menu_set_text(), menu_show(), and on_menu_item().

const char* notepad::MENU = "notepad_menu" [static]

Definition at line 74 of file notepad_ipc.cpp.

Referenced by menu_init().

const char* notepad::MENU_STATE_DISABLED = "disabled" [static]

Definition at line 108 of file notepad_ipc.cpp.

Referenced by ipc_menu_set_pagecounter().

const char* notepad::MENU_STATE_NORMAL = "normal" [static]

Definition at line 106 of file notepad_ipc.cpp.

Referenced by ipc_menu_set_pagecounter(), menu_show(), and on_menu_item().

const char* notepad::MENU_STATE_SELECTED = "selected" [static]

Definition at line 107 of file notepad_ipc.cpp.

Referenced by menu_show().

const char* notepad::SCRIBBLE_LAST_READ_LOCATION = "scribble_last_read_location" [static]
Initial value:
 {
        { on_menu_item,         "menuItemActivated",   NULL                        , 0 },
        { on_window_activated,  "activatedWindow",     NULL                        , 0 },
        { on_window_deactivated,"deactivatedWindow",   NULL                        , 0 },
        { on_page_change,       "pageChange",          NULL                        , 0 },
        { on_changed_pen,       "statusItemActivated", NULL                        , 0 },
        { on_changed_locale,    "sysChangedLocale",    DBUS_SERVICE_SYSTEM_CONTROL , 0 },
        { on_prepare_unmount,   "sysPrepareUnmount",   DBUS_SERVICE_SYSTEM_CONTROL , 0 },
        { on_volume_unmounted,  "sysVolumeUnmounted",  DBUS_SERVICE_SYSTEM_CONTROL , 0 },
        { on_prepare_standby,   "sysPrepareStandby",   DBUS_SERVICE_SYSTEM_CONTROL , 0 },


 
        { on_changed_orientation, "sysChangedOrientation",  DBUS_SERVICE_SYSTEM_CONTROL , 0 },
        { NULL, NULL, NULL, 0 }  
    }

Definition at line 190 of file notepad_ipc.cpp.

Referenced by ipc_set_services(), and ipc_unset_services().

const char* notepad::STYLUS_ERASER = "eraser" [static]

Definition at line 112 of file notepad_ipc.cpp.

Referenced by menu_show(), and on_changed_pen().

const char* notepad::STYLUS_PEN = "pen" [static]

Definition at line 111 of file notepad_ipc.cpp.

Referenced by menu_show(), and on_changed_pen().

const char* notepad::THUMBNAIL_COLUMNS[CThumbnail::THUMBNAIL_COUNT] [static]
Initial value:
    {
        "thumb_data_mini", 
        "thumb_data_small",
        "thumb_data_medium",
        "thumb_data_large" 
    }

Definition at line 46 of file notepad_thumbnail.cpp.

Generated by  doxygen 1.6.2-20100208