update code style

This commit is contained in:
vcaesar 2018-06-11 21:47:55 +08:00
parent 567604a5e1
commit 28c7ccf563
3 changed files with 19 additions and 18 deletions

View File

@ -8,6 +8,16 @@
// option. This file may not be copied, modified, or distributed // option. This file may not be copied, modified, or distributed
// except according to those terms. // except according to those terms.
#include "bitmap_class.h"
#include "bitmap_find_c.h"
#include "../base/color_find_c.h"
// #include "../screen/screen_c.h"
#include "../base/io_c.h"
#include "../base/pasteboard_c.h"
#include "../base/str_io_c.h"
#include <assert.h>
#include <stdio.h>
// class BMP // class BMP
// { // {
// public: // public:
@ -18,15 +28,6 @@
// uint8_t bytesPerPixel; // uint8_t bytesPerPixel;
// uint8_t *image; // uint8_t *image;
// }; // };
#include "bitmap_class.h"
#include "bitmap_find_c.h"
#include "../base/color_find_c.h"
// #include "../screen/screen_c.h"
#include "../base/io_c.h"
#include "../base/pasteboard_c.h"
#include "../base/str_io_c.h"
#include <assert.h>
#include <stdio.h>
/* Returns false and sets error if |bitmap| is NULL. */ /* Returns false and sets error if |bitmap| is NULL. */
bool bitmap_ready(MMBitmapRef bitmap){ bool bitmap_ready(MMBitmapRef bitmap){

View File

@ -99,22 +99,22 @@ MMSize get_screen_size(){
char* set_XDisplay_name(char* name){ char* set_XDisplay_name(char* name){
#if defined(USE_X11) #if defined(USE_X11)
setXDisplay(name); setXDisplay(name);
return "success"; return "success";
#else #else
return "setXDisplayName is only supported on Linux"; return "setXDisplayName is only supported on Linux";
#endif #endif
} }
char* get_XDisplay_name(){ char* get_XDisplay_name(){
#if defined(USE_X11) #if defined(USE_X11)
const char* display = getXDisplay(); const char* display = getXDisplay();
char* sd = (char*)calloc(100, sizeof(char*)); char* sd = (char*)calloc(100, sizeof(char*));
if(sd)strcpy(sd, display); if(sd)strcpy(sd, display);
return sd; return sd;
#else #else
return "getXDisplayName is only supported on Linux"; return "getXDisplayName is only supported on Linux";
#endif #endif
} }

View File

@ -41,7 +41,7 @@ MMBitmapRef copyMMBitmapFromDisplayInRect(MMRect rect){
bufferSize = CFDataGetLength(imageData); bufferSize = CFDataGetLength(imageData);
buffer = malloc(bufferSize); buffer = malloc(bufferSize);
CFDataGetBytes(imageData, CFRangeMake(0,bufferSize), buffer); CFDataGetBytes(imageData, CFRangeMake(0, bufferSize), buffer);
bitmap = createMMBitmap(buffer, bitmap = createMMBitmap(buffer,
CGImageGetWidth(image), CGImageGetWidth(image),