GithubHelp home page GithubHelp logo

Comments (4)

gansm avatar gansm commented on September 28, 2024 1

Thank you for your inquiry and your interest in FINAL CUT. Unfortunately, I can't get enough information from your request to understand your problem. The Linux framebuffer console works fine with FINAL CUT if the TERM environment variable is set to "linux".

fb

finalcut-window

Here is a small C program to test the Linux framebuffer:

#include <sys/types.h>
#include <sys/ioctl.h>
#include <sys/mman.h>

#include <linux/fb.h>

#include <unistd.h>
#include <fcntl.h>

#include <stdio.h>

int main()
{
   struct fb_var_screeninfo screen_info;
   struct fb_fix_screeninfo fixed_info;
   char *buffer = NULL;
   size_t buflen;
   int fd = -1;
   int r = 1;
   int x,y;

   fd = open("/dev/fb0", O_RDWR);

   if ( fd >= 0 )
   {
      if ( ! ioctl(fd, FBIOGET_VSCREENINFO, &screen_info)
        && ! ioctl(fd, FBIOGET_FSCREENINFO, &fixed_info) )
      {
         buflen = screen_info.yres_virtual * fixed_info.line_length;
         buffer = mmap(NULL,
                       buflen,
                       PROT_READ|PROT_WRITE,
                       MAP_SHARED,
                       fd,
                       0);

         if ( buffer != MAP_FAILED )
         {
             printf ("Framebuffer works on this pc!\n");
             printf ("     Name : %s\n", fixed_info.id);
             printf ("  Address : %ld\n", fixed_info.smem_start);
             printf ("     Size : %d\n", fixed_info.smem_len);
             printf ("     xres : %d\n", screen_info.xres);
             printf ("     yres : %d\n", screen_info.yres);
             printf ("      bpp : %d\n", screen_info.bits_per_pixel);

             for (x=0; x < screen_info.xres; x++)
             {
               /* white line */
               *(buffer + (x * screen_info.bits_per_pixel/8) ) = 0xff;    /* blue */
               *(buffer + (x * screen_info.bits_per_pixel/8) + 1) = 0xff; /* green */
               *(buffer + (x * screen_info.bits_per_pixel/8) + 2) = 0xff; /* red */

               *(buffer + (x * screen_info.bits_per_pixel/8) + fixed_info.line_length * (screen_info.yres-1) ) = 0xff; /* blue */
             }
             for (y=0; y < screen_info.yres; y++)
             {
               *(buffer + (y * screen_info.xres) * (screen_info.bits_per_pixel/8) + 1) = 0xff; /* green */
               *(buffer + (y * screen_info.xres + screen_info.xres-1) * (screen_info.bits_per_pixel/8) + 2) = 0xff; /* red */
             }
             r = 0;   /* Indicate success */
         }
         else
         {
            perror("mmap");
         }
      }
      else
      {
         perror("ioctl");
      }
   }
   else
   {
      perror("open");
   }

   /*
    * Clean up
    */
   if (buffer && buffer != MAP_FAILED)
     munmap(buffer, buflen);

   if (fd >= 0)
     close(fd);

   return r;
}

/*  gcc framebuffer-check.c -o framebuffer-check */

Unfortunately, I don't know what kind of hardware, CPU architecture, and distribution you are developing. If you could give me more details or specific scenarios about the problems, I might be able to help you.

from finalcut.

gansm avatar gansm commented on September 28, 2024 1

That looks like an interesting project. Let me see how I can help you.

In the first photo, I can see that you are running your display at a resolution of 320×240 pixels. The used font should be a standard CGA font with a character size of 8×8 pixels. That should give you a text mode with 40 columns and 30 lines.

The "cam viewer" window in the second photo is cut off on the right side, so you probably have a window size of more than 40 characters. Should your window be exactly 40 characters wide, you only need to move the window one character to the left.

In the third image, now with a character size of 9×18 pixels, I have difficulty following your execution. What am I seeing here? What is the other screen? Has the display been replaced? Is there a second output device on your evaluation board? Or is the screenshot from a completely different device?

When you open the file-open-chooser, it appears in the center of your terminal screen. This means that, if your main window is in the center of the screen, the FFileDialog widget will be displayed over the main window.

For example:

auto filename = finalcut::FFileDialog::fileOpenChooser (this, directory, filter);

if ( ! filename.isEmpty() )
{
  // open filename...
}

If you require a different positioning behavior, please create a class derived from FFileDialog and overload the FFileDialog::adjustSize() method with your own code.

It is difficult for me to find a more precise solution without seeing your code and more information about your application.

I hope I was able to help you.

from finalcut.

mahdi2001h avatar mahdi2001h commented on September 28, 2024 1

Thanks a lot
My problem solved with use FFileDialog::adjustSize() method

from finalcut.

mahdi2001h avatar mahdi2001h commented on September 28, 2024

thank for your help

i'm using allwinner v3s chip with sinux v3 board

the value of TERM variable is linux and this is output of commands
photo_2024-01-01_18-49-27

this is my program output in this display
photo_2024-01-01_18-49-13
and this is output in other screen (with bigger size!)
photo_2024-01-01_18-49-32

also I have a FFileDialog that i want to open on top of the main windows
what i should to do for this ?

dialog on bigger screen
image

i think the problem is screen resolution
Do you have any suggestions to fix this problem?

from finalcut.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.