Beispiel #1
0
void IliadToolbar::initialize()
{
	//initialize events
	eventHandler = new ToolBarEventHandler();
	
    // busy indicator
    erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);

    // pagebar
    erIpcStartClient(ER_PAGEBAR_CHANNEL, &erpagebarChannel);
    
    // toolbar 
    erIpcStartClient(ER_TOOLBAR_CHANNEL, &ertoolbarChannel);
    tbSelectIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
    
    // disable redraw
    tbDisableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID); 
    tbClearIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
    
    // trashcan
    tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, -1);
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, iconState_grey );
	
	// keyboard
    tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, -1);
    tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_grey );
	
	tbEnableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);

    //nPanState = nZoominState = nZoomoutState = iconState_normal;
    //nZoombackState = iconState_grey;
    //nContinousState = iconState_normal;
    //nRotateState = PortraitToLandscape;
    //nBackwardState = nForwardState = iconState_grey;
}
Beispiel #2
0
void toolbar_init()
{
    int returnValue;

    ST_LOGPRINTF("entry");

    // create/init the channel to communicate with the toolbar service
    returnValue = erIpcStartClient(ER_TOOLBAR_CHANNEL, &toolbarChannel);

    if (returnValue != 0)
    {
        ST_WARNPRINTF("erIpcStartClient returned %d", returnValue);
        return;
    }
}
Beispiel #3
0
void toolbar_init()
{
    int     returnValue;

    SB_IPCPRINTF("\n\n\nentry,ER_TOOLBAR_CHANNEL=%d\n\n",
                 ER_TOOLBAR_CHANNEL);
    toolbarChannel=NULL;
    // create/init channel to communicate with the toolbar service
    returnValue = erIpcStartClient(ER_TOOLBAR_CHANNEL, &toolbarChannel);
    if (returnValue != 0)
    {
        SB_ERRORPRINTF("erIpcStartClient returned %d\n", returnValue);
        return;
    }
    // tell toolbar which icons set to display
    tbSelectIconSet(toolbarChannel, ER_SCRIBBLE_UA_ID);
}
Beispiel #4
0
int main(int argc, char *argv[])
{
    char device[5] = "";
    int present = 0;
    
    if ( argc != 3 )
    {
        usage();
        return 1;
    }
    
    // Check 'present' parameter. If not used correctly, make it 0
    present = atoi(argv[2]);
    if (present != 1)
    {
        present = 0;
    }
    
    if (strcasecmp(CF_ID, argv[1]) == 0)
    {
        strcpy(device, CF_ID);
    }
    else if (strcasecmp(SD_ID, argv[1]) == 0)
    {
        strcpy(device, SD_ID);
    }
    else if (strcasecmp(USB_ID, argv[1]) == 0)
    {
        strcpy(device, USB_ID);
    }
    else
    {
        usage();
        return 1;
    }

#ifdef DEBUG
    printf("clNotify: %s is now %s\n", device, (present == 1) ? "present" : "removed");
#endif
    
    erIpcStartClient(erIpcGetChannel(ER_CONTENT_LISTER_UA_ID), &contentListerChannel);
    clStoragePresent(contentListerChannel, device, present);
    return 0;
}
Beispiel #5
0
int main(int argc, char *argv[])
{
    GtkWidget*  window;
    shareMgr_t* theShareMgr;
    int         nRet;
    gboolean    ok;

    // catch the SIGTERM signal
    struct sigaction on_term;
    memset(&on_term, 0x00, sizeof(on_term));
    on_term.sa_handler = on_sigterm;
    sigaction(SIGTERM, &on_term, NULL);

    DL_WARNPRINTF(PACKAGE_STRING);

    parse_arguments(argc, argv);

    // minimum battery charge required for background mode
    if (g_background)
    {
        if (get_battery_charge() <= BATTERY_MINCHARGE_BACKGROUND)
        {
            DL_ERRORPRINTF("Insufficient battery [%d] for background PC connect -> quit", get_battery_charge());
            return NO_ERROR;
        }
    }
    
    /* init threads */
    g_thread_init(NULL);
    gdk_threads_init();

    // open the RC file associated with this program (re-use the downloadMgr one)
    gtk_rc_parse(DATA_DIR "/downloadMgr.rc");
    DL_LOGPRINTF("rc file %s", DATA_DIR "/downloadMgr.rc");

    gtk_init(&argc, &argv);

    load_registry();
    languagesInit();
    
    // create/init the channel to communicate with the content lister
    nRet = erIpcStartClient(ER_CONTENTLISTER_CHANNEL, &contentListerChannel);
    if (nRet != 0)
    {
        DL_ERRORPRINTF("erIpcStartClient returned %d", nRet);
        contentListerChannel = NULL;
    }

    // create the main, top level, window 
    window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title(GTK_WINDOW(window), PACKAGE " " VERSION);
    gtk_window_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
    gtk_container_set_border_width(GTK_CONTAINER(window), 0);
    // gtk_widget_set_size_request(GTK_WIDGET(window), SCREEN_WIDTH, SCREEN_HEIGHT);
    gtk_window_set_modal(GTK_WINDOW(window), FALSE);
    gtk_window_set_resizable(GTK_WINDOW(window), FALSE);
    gtk_window_fullscreen(GTK_WINDOW(window)); // Fullscreen overlap taskbars

    theShareMgr = ctrlInit(window);

    if (theShareMgr)
    {
        // Connect the destroy event of the window with our on_destroy function
        // When the window is about to be destroyed we get a notification and
        // stop the main GTK loop
        g_signal_connect(G_OBJECT(window), "destroy", G_CALLBACK(on_destroy), NULL);

        // make sure that everything, window and label, are visible 
        if ( !g_background )
        {
            gtk_widget_show(window);
        }
    }

    // Start the download thread
    ok = shareThread_start((gpointer)theShareMgr);
    if (!ok)
    {
        printf("%s %s: ", __FILE__, __FUNCTION__);
        perror("Could not create thread\n");
    }

    // run the GTK main loop
    DL_LOGPRINTF("Before gtk_main");
    gdk_threads_enter();
    gtk_main();
    gdk_threads_leave();
    nRet = theShareMgr->returnVal;
    DL_LOGPRINTF("exitValue after gtk_main [%d]", nRet);

    // GTK done, abort any copying that might be running
    shareThread_stop();
    shareThread_wait(15);

    DL_WARNPRINTF("PC Share Manager quitting with return value \"%d\"", nRet);
    ctrlDestroy(theShareMgr);

    release_registry();

    return nRet;
}
Beispiel #6
0
void contentlister_init()
{
    BR_IPCPRINTF("entry");
    erIpcStartClient(ER_CONTENTLISTER_CHANNEL, &contentListerChannel);
}